#357682 bzip2: bunzip2 --force fails on pipes, *unlike* gunzip

Package:
bzip2
Source:
bzip2
Description:
high-quality block-sorting file compressor - utilities
Submitter:
Date:
2010-08-20 14:03:03 UTC
Severity:
normal
#357682#5
Date:
2006-03-18 22:52:39 UTC
From:
To:
$ tail -2 /etc/motd  | zcat --force
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
$ tail -2 /etc/motd  | bunzip2  --force
$

There are two reasons this bothers me:
  1. --force is documented in reference to gzip, so it should act like it
  2. This makes it impossible to implement a "generic decompress
     pipeline", namely,
     | zcat --force | bunzip2 --force (etc.)

ltrace confirms that it's doing a naive rewind; a third point would be
that it's a bug that it doesn't give an error in this case, but
silently outputs nothing, potentially very bad in a pipeline.  But I
don't care about that, I want the zcat-style behaviour :-)

BZ2_bzReadOpen(0xbffffab8, 0xb7fbe820, 0, 0, 0xbfffd33c) = 0x8050048
BZ2_bzRead(0xbffffab8, 0x8050048, 0xbfffe6c4, 5000, 0xbfffd33c) = 0
rewind(0xb7fbe820, 0x8050048, 0xbfffe6c4, 5000, 0xbfffd33c) = -1
fgetc(0xb7fbe820)                                   = 'EOF'
ferror(0xb7fbe820)                                  = 0
fclose(0xb7fbe820)                                  = 0

#357682#10
Date:
2010-08-20 13:59:34 UTC
From:
To: