Hi,

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'

;-)

-- 
Best regards,
Michał Górny

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to