Micha? Górny <mgo...@gentoo.org> wrote: > Here's another quirk I've found: > > $ echo test > BZh5 > $ tar --format=v7 -cf test.tar BZh5 > $ tar -xf test.tar > bzip2: stdin: compressed data error: bad block header magic > tar: Child returned status 1 > tar: Error is not recoverable: exiting now > > I think the easiest solution would be to copy the trick used > by libarchive, citing: > > /* After BZh[1-9], there must be either a data block > * which begins with 0x314159265359 or an end-of-data > * marker of 0x177245385090. */ > > However, this wouldn't help with the harder (though less likely to occur > accidentally) case of: > > $ echo test > 'BZh91AY&SY'
An interesting discovery! I however believe that the format recognition in "star" would not be fooled by this and since star first checks for archive formats before it checks for compression, this should not be a problem. BTW: I could not trigger this problem with older gtar versions, when did gtar introduce automated compression detection? Jörg -- EMail:jo...@schily.net (home) Jörg Schilling D-13353 Berlin joerg.schill...@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.org/private/ http://sf.net/projects/schilytools/files/'