That's odd.  I can't reproduce the problem on Fedora 17,
with either the bundled gzip (1.4) or with
gzip 1.5 (which I built myself).  For example:

$ rm test.gz x.gz
$ : | gzip >test.gz
$ dd if=/dev/zero bs=1 count=77 >> test.gz
77+0 records in
77+0 records out
77 bytes (77 B) copied, 0.000514876 s, 150 kB/s
$ dd if=test.gz count=1 bs=22 > x.gz
1+0 records in
1+0 records out
22 bytes (22 B) copied, 0.000159583 s, 138 kB/s
$ gunzip -tv x.gz
x.gz:   
gzip: x.gz: decompression OK, trailing zero bytes ignored
 OK
$ dd if=test.gz count=1 bs=21 > x.gz
1+0 records in
1+0 records out
21 bytes (21 B) copied, 0.0446526 s, 0.5 kB/s
$ gunzip -tv x.gz
x.gz:   
gzip: x.gz: decompression OK, trailing zero bytes ignored
 OK
$ dd if=test.gz count=1 bs=20 > x.gz
1+0 records in
1+0 records out
20 bytes (20 B) copied, 0.0646803 s, 0.3 kB/s
$ gunzip -tv x.gz
x.gz:    OK


This all looks right.  (You wrote that the last output
was "unexpected", but the compressed file is 20 bytes,
right? so the 20-byte copy should work.)

For the 21-byte case, can you please send the output of
the command

strace -o trace.txt gunzip -tv x.gz

That is, what gets put into the file trace.txt?

Reply via email to