Update gzip.
authorPeter Avalos <pavalos@theshell.com>
Sat, 18 Jul 2009 23:35:46 +0000 (13:35 -1000)
committerPeter Avalos <pavalos@theshell.com>
Sat, 18 Jul 2009 23:35:46 +0000 (13:35 -1000)
commit00e71414e08d7af9e370d8c97f6dbd57ac5a42a3
tree9964be8dac2af3984c0b06d19baeebbbbcb7e8c4
parent4c6b389e5432d9c018fd45c4a7e4f747d3bc3f3a
Update gzip.

- gzexe: Ensure we do not compress files we need for decompressing by
also checking hard links. From Andrew Dalgleish. (from OpenBSD)
- note that -n also stops the timestamp from being output.
- Don't abort decompression if there are no bytes in the output buffer
when the end of compressed block (ie the crc) is reached.
(ie when decompressing concatenated zipped files).
- If stdin is the input stream, fstat it and check if it's
file. If so, use it's mtime for the mtime in the header. Otherwise use
time(2)'s result instead. Lines up with GNU gzip and RFC 1952 now as
well.
- Fix parsing of $GZIP so that not to overrun the end of string.
- handle partial reads.
- avoid an infinite loop while decompressing invalid gzip files.
- in file_compress() always stat() the input file.  this patch avoids
reading from uninitialised space.
- Fix a few issues:
 gzip -vt just prints the contents of a .Z file
 gzip -vt will print OK even if the .gz file is corrupt
 gzip -vt prints nothing with a .bz2 file
 gzip can loop endlessly with a corrupt .bz2 file
- Don't warn about >4GB files not having their size correctly stored.
- Remove unhandled H option from getopt() argument. Describe -l in usage.
- properly check the return value of read() & pread().
- Delete impossible code.
- Abort decompression with an error when EOF is reached on input. The
test output will then be 'NOT OK'.
- End a decompression when trailing garbage is found. It emits a warning
message and causes a non-zero exit status (similar to GNU gzip).
- properly detect when the output fails (eg, full filesystem) and do not
delete the input file.

Dragonfly-bug: http://bugs.dragonflybsd.org/issue1026
13 files changed:
usr.bin/gzip/Makefile
usr.bin/gzip/gzexe
usr.bin/gzip/gzexe.1
usr.bin/gzip/gzip.1
usr.bin/gzip/gzip.c
usr.bin/gzip/unbzip2.c
usr.bin/gzip/zdiff.1
usr.bin/gzip/zgrep
usr.bin/gzip/zgrep.1
usr.bin/gzip/zmore
usr.bin/gzip/zmore.1
usr.bin/gzip/znew
usr.bin/gzip/zuncompress.c