summaryrefslogtreecommitdiffstats
path: root/usr.bin/gzip/gzip.c
Commit message (Collapse)AuthorAgeFilesLines
* Incorporate recent changes from NetBSD. Most notable change is the additiondelphij2011-10-101-28/+67
| | | | | | of support of decompressing xz files. Obtained from: NetBSD
* Fix a regression introduced with previous changeset: if output is stdout,delphij2011-05-251-1/+2
| | | | do not check for symbolic link.
* Match symbolic link handling behavior with GNU gzip, bzip2 and xz:delphij2011-05-231-1/+1
| | | | | | | | When we are operating on a symbolic link pointing to an existing file, bail out by default, but go ahead if -f is specified. Submitted by: arundel MFC after: 2 weeks
* Diff reduction against NetBSD. The most notable change is to zdiff(1) todelphij2011-05-231-4/+5
| | | | | | handle more file formats including bzip2 and xz. MFC after: 2 weeks
* Correct some typos in comments, no functional changes.bcr2010-10-161-1/+1
|
* In the past gunzip(1) write()'s after each inflate return. This isdelphij2010-09-231-0/+2
| | | | | | | | | | | | | | not optimal from a performance standpoint since the write buffer is not necessarily be filled up when the inflate rountine reached the end of input buffer and it's not the end of file. This problem gets uncovered by trying to pipe gunzip -c output to a GEOM device directly, which enforces the writes be multiple of sector size. Sponsored by: iXsystems, Inc. Reported by: jpaetzel MFC after: 2 weeks
* Several style fixes as prompted by bde@.delphij2010-06-101-28/+22
| | | | | While I'm there, loosen the st_nlink check and fix grammar for 1 extra links.
* Follow up revision 208888 with purely ident changes.delphij2010-06-071-6/+6
| | | | MFC after: 1 week
* Correct a bug in gzip(1): make sure that initialize isb with fstat() ondelphij2010-06-071-3/+9
| | | | | | | | input file before using it. PR: bin/147275 Submitted by: thomas MFC after: 1 week
* Use _exit(2) system call directly instead of using exit(3) in signaldelphij2010-04-271-1/+1
| | | | | | | | handler, as the latter is not guaranteed to be signal safe, and we do not really care about flushing the stream during SIGINT. Suggested by: Maxim Konovalov <maxim.konovalov gmail com> MFC after: 13 days
* Add a signal handler for SIGINT which removes output file when necessary.delphij2010-04-261-4/+21
| | | | | | | While I'm there, move unlink_input() slightly down to after closing the output file, in uncompression path. MFC after: 2 weeks
* Diff reduction against NetBSD and add myself to AUTHORS section of thedelphij2010-04-071-8/+6
| | | | | manual page as I wrote the unpack functionality. No actual executable code change verified with md5(1).
* Change all our own code to use st_*tim instead of st_*timespec.ed2010-03-281-2/+2
| | | | Also remove some local patches to diff(1) which are now unneeded.
* Correct a stack underflow in gzip:delphij2009-07-311-1/+5
| | | | | | | | | | | | | | - Limit suffix to be no more than 30 bytes long. This matches GNU behavior. - Correct usage of memcpy(). Note that this commit only corrects the stack underflow issue, we still need some other fixes to cover other edges. [1] Reported by: Ron Jude <ronj wytheville org> Discussed with: Matthew Green (original NetBSD gzip author), Eygene Ryabinkin <rea-fbsd codelabs ru> [1] Approved by: re (kib)
* Sync with NetBSD:delphij2009-06-241-3/+3
| | | | | | | | | | - gzip -n does not store timestamp; [1] - Reduce diff against NetBSD by moving some casts in our local versions. PR: bin/134955 Obtained from: NetBSD MFC after: 1 month
* Add support for uncompressing pack(1)'ed files. Pack(1) is a program founddelphij2009-06-211-1/+37
| | | | | | | | | | | | in some commercial Unix systems, which utilizes Huffman minimum redundancy code tree to compress files. This implementation supports the "new" pack format only, just like GNU gzip did. Thanks for oliver@'s archive set which I can test against, and Mingyan Guo for providing helpful review of my code. PR: bin/109567 MFC after: 1 month
* Two fixes for SMALL case when compiling with WARNS=6:delphij2009-06-191-1/+4
| | | | | | | - Reduce scope where return value can be referenced. - Add a dummy access to timestamp to silence warning. Submitted by: Mingyan Guo <guomingyan gmail com>
* Mark functions as __dead2 in order to help the LLVM static checkercperciva2008-08-041-2/+2
| | | | | | understand which code paths aren't possible. Reported by: edwin
* Sync with NetBSD's license changes.delphij2008-07-231-7/+3
|
* Teach gunzip that .tbz and .tbz2 uncompress to .tar, in a manner similar torwatson2008-03-091-0/+2
| | | | | | | | its existing understanding that .tgz uncompresses to .tar. MFC after: 3 days PR: 121519 Submitted by: Ighighi <ighighi at gmail.com>
* When gzipping to a target file, only set the source file flags on therwatson2008-03-091-4/+4
| | | | | | | | | target file after the timestamp has been set; otherwise setting the timestamp will fail if the flags don't permit it (i.e., uchg). MFC after: 1 week PR: 120208 Submitted by: Ighighi <ighighi at gmail.com>
* - Simulate GNU gzip(1) behavior where full filename isdelphij2007-07-121-7/+7
| | | | | | | | | being output in verbose mode when doing recursive[1]. - Use better representation of S: PR: bin/114470 Submitted by: Ighighi <ighighi gmail com> [1] Approved by: re (hrs)
* Add a '-k' flag which is similar with its bzip2(1) counterpart,delphij2007-05-281-2/+10
| | | | | | | | meaning that the user wants the input file to be left intact. Feature request: Ighighi <ighighi gmail.com> PR: bin/103006 MFC after: 1 month
* Fix typo.delphij2007-01-311-1/+1
| | | | Obtained from: DragonFly
* Replace the GNU gzip with a slightly modified NetBSD gzip. Thedelphij2007-01-261-0/+2054
NetBSD version is a feature-to-feature re-implementation of GNU gzip using the freely-redistributable zlib and this version is expected to be mostly bug-to-bug compatible with the GNU implementation. - Because this is a piece of mature code and we want to make changes so it is added directly rather than importing to src/contrib. - Connect newly added code to src/usr.bin/ and rescue/rescue build. - Disconnect the GNU gzip code from build for now, they will be eventually removed completely. - Provide two new src.conf(5) knobs, WITHOUT_BZIP2_SUPPORT and WITHOUT_BZIP2. Tested by: kris (full exp-7 pointyhat build) Approved by: core (importing a 4-clause BSD licensed file) Approved by: re (adding new utility during -HEAD code slush)
OpenPOWER on IntegriCloud