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: