$ 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