summaryrefslogtreecommitdiffstats
path: root/usr.bin/compress/compress.c
Commit message (Collapse)AuthorAgeFilesLines
* Don't truncate the output file before making sure that we cantrhodes2003-06-141-6/+17
| | | | | | | | | | | | | | | | | | | | | read at least 1 byte from the input file without problems. This fixes a bug in uncompress(1) that causes the accidental removal of files that happen to have the same name as the output file, even when the uncompression fails and is aborted, i.e.: $ echo hello world > hello $ touch hello.Z $ ls -l hello* -rw-rw-r-- 1 giorgos giorgos 12 Jun 14 13:33 hello -rw-rw-r-- 1 giorgos giorgos 0 Jun 14 13:33 hello.Z $ ./uncompress -f hello uncompress: hello.Z: Inappropriate file type or format $ ls -l hello* -rw-rw-r-- 1 giorgos giorgos 0 Jun 14 13:33 hello.Z $ PR: 46787 Submitted by: keramida
* ANSIify function definitions to avoid a warning.dwmalone2002-07-281-16/+6
|
* As required by SUSv3, a file argument of "-" causes standard inputtjr2002-05-171-1/+8
| | | | to be compressed/decompressed to standard output.
* Compression ratio statistics should be written to stderr instead of stdout.tjr2002-05-171-4/+5
|
* Use exit status 2 to indicate that the file was not compressed becausetjr2002-05-171-0/+1
| | | | its size would not be reduced (SUSv3).
* unifdef -D__STDC__imp2002-03-231-28/+3
|
* remove __Pimp2002-03-221-7/+7
|
* Style improvements recommended by Bruce as a follow up to somedwmalone2001-12-101-5/+6
| | | | | | | | of the recent WARNS commits. The idea is: 1) FreeBSD id tags should follow vendor tags. 2) Vendor tags should not be compiled (though copyrights probably should). 3) There should be no blank line between including cdefs and __FBSDIF.
* Use __FBSDID().markm2001-12-021-6/+6
| | | | | Use a better choice than size_t for vertain variables. Fix some comment alignment.
* WARNS=2 fix and 'register' removal.markm2001-12-021-11/+11
|
* Mark some functions as __printflike()kris2001-07-051-2/+2
| | | | MFC after: 1 week
* Don't depend on <sys/stat.h> bogusly including <sys/time.h> (and therebywollman2000-10-101-0/+1
| | | | <time.h>).
* From PR submitter:hoek2000-05-161-2/+2
| | | | | | | | | | | | compress uses setfile() to make flags, ownership and mode of the output the same as those of the original. However, if the filesystem holding the output file doesn't support these operations, compress prints a warning. This bites a bit with NFS directories, which always fail the chflags() operation. If the file system doesn't support the operation, then the flags data wasn't valid on the original file anyway, so the warning is spurious. Submitted by: bin/16981 (Peter Edwards <peter.edwards@ireland.com>)
* Add DIAGNOSTICS section name. Spellingcharnier2000-03-261-3/+6
|
* Tweaks to allow compiling -Wall (mostly adding "const" to char rcsid[]).archie1998-12-061-2/+2
|
* Fixed previous commit to actually work. The wrong variable was initializedbde1998-10-211-3/+4
| | | | | earlier (with style bugs of course), so zcat was an alias for uncompress instead of `uncompress -c'.
* Behave like zcat if invoked as zcat. We don't install as zcat; this justmsmith1998-10-201-2/+5
| | | | | | makes us more useful in a tight environment. Submitted by: Wilfredo Sanchez <wsanchez@apple.com>
* compare return value from getopt against -1 rather than EOF, per the finalimp1997-03-291-1/+1
| | | | posix standard on the topic.
* Finished adjustments for cleaning up declaration of zopen(). Moving thebde1996-09-051-0/+2
| | | | declaration from <stdio.h> to "zopen.h" left it undeclared here.
* Remove trailing whitespace.rgrimes1995-05-301-1/+1
|
* BSD 4.4 Lite Usr.bin Sourcesrgrimes1994-05-271-0/+444
OpenPOWER on IntegriCloud