aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/compress/compress.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-231-2/+0
| | | | | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/ Similar commit in main: (cherry picked from commit 1d386b48a555)
* Fix descriptor/memory leak in compress(1) codeOleksandr Tymoshenko2019-01-181-0/+2
| | | | | | | | | | | | This is mostly a style fix since the code in question is not called multiple times and doesn't have cummulative effect. PR: 204953 Submitted by: David Binderman <dcb314@hotmail.com> MFC after: 1 week Notes: svn path=/head/; revision=343127
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* compress: Allow uncompress -c with multiple pathnames, as required by POSIX.Jilles Tjoelker2017-05-211-1/+1
| | | | | | | | | | | | | | Per POSIX, allow passing multiple pathnames to uncompress -c, concatenating the uncompressed data. Passing multiple pathnames to compress -c remains disallowed, since the result cannot be decompressed. PR: 219387 Reported by: Jörg Schilling Notes: svn path=/head/; revision=318592
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* compress,gzip,xz: Preserve timestamps with nanosecond precision.Jilles Tjoelker2015-02-171-5/+6
| | | | Notes: svn path=/head/; revision=278896
* Replace index() and rindex() calls with strchr() and strrchr().Ed Schouten2012-01-031-3/+3
| | | | | | | | | | | | | The index() and rindex() functions were marked LEGACY in the 2001 revision of POSIX and were subsequently removed from the 2008 revision. The strchr() and strrchr() functions are part of the C standard. This makes the source code a lot more consistent, as most of these C files also call into other str*() routines. In fact, about a dozen already perform strchr() calls. Notes: svn path=/head/; revision=229403
* Mark global functions and/or variables in compress(1) static where possible.Ed Schouten2011-11-061-15/+15
| | | | | | | This allows compilers and static analyzers to more thorough analysis. Notes: svn path=/head/; revision=227236
* Remove the advertising clause from UCB copyrighted files in usr.bin. ThisJoel Dahl2010-12-111-4/+0
| | | | | | | | | | | | is in accordance with the information provided at ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change Also add $FreeBSD$ to a few files to keep svn happy. Discussed with: imp, rwatson Notes: svn path=/head/; revision=216370
* Change all our own code to use st_*tim instead of st_*timespec.Ed Schouten2010-03-281-2/+2
| | | | | | | Also remove some local patches to diff(1) which are now unneeded. Notes: svn path=/head/; revision=205793
* Don't truncate the output file before making sure that we canTom Rhodes2003-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 Notes: svn path=/head/; revision=116336
* ANSIify function definitions to avoid a warning.David Malone2002-07-281-16/+6
| | | | Notes: svn path=/head/; revision=100820
* As required by SUSv3, a file argument of "-" causes standard inputTim J. Robbins2002-05-171-1/+8
| | | | | | | to be compressed/decompressed to standard output. Notes: svn path=/head/; revision=96772
* Compression ratio statistics should be written to stderr instead of stdout.Tim J. Robbins2002-05-171-4/+5
| | | | Notes: svn path=/head/; revision=96770
* Use exit status 2 to indicate that the file was not compressed becauseTim J. Robbins2002-05-171-0/+1
| | | | | | | its size would not be reduced (SUSv3). Notes: svn path=/head/; revision=96769
* unifdef -D__STDC__Warner Losh2002-03-231-28/+3
| | | | Notes: svn path=/head/; revision=93055
* remove __PWarner Losh2002-03-221-7/+7
| | | | Notes: svn path=/head/; revision=92920
* Style improvements recommended by Bruce as a follow up to someDavid Malone2001-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. Notes: svn path=/head/; revision=87628
* Use __FBSDID().Mark Murray2001-12-021-6/+6
| | | | | | | | Use a better choice than size_t for vertain variables. Fix some comment alignment. Notes: svn path=/head/; revision=87247
* WARNS=2 fix and 'register' removal.Mark Murray2001-12-021-11/+11
| | | | Notes: svn path=/head/; revision=87214
* Mark some functions as __printflike()Kris Kennaway2001-07-051-2/+2
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=79305
* Don't depend on <sys/stat.h> bogusly including <sys/time.h> (and therebyGarrett Wollman2000-10-101-0/+1
| | | | | | | <time.h>). Notes: svn path=/head/; revision=66907
* From PR submitter:Tim Vanderhoek2000-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>) Notes: svn path=/head/; revision=60622
* Add DIAGNOSTICS section name. SpellingPhilippe Charnier2000-03-261-3/+6
| | | | Notes: svn path=/head/; revision=58630
* Tweaks to allow compiling -Wall (mostly adding "const" to char rcsid[]).Archie Cobbs1998-12-061-2/+2
| | | | Notes: svn path=/head/; revision=41568
* Fixed previous commit to actually work. The wrong variable was initializedBruce Evans1998-10-211-3/+4
| | | | | | | | earlier (with style bugs of course), so zcat was an alias for uncompress instead of `uncompress -c'. Notes: svn path=/head/; revision=40547
* Behave like zcat if invoked as zcat. We don't install as zcat; this justMike Smith1998-10-201-2/+5
| | | | | | | | | makes us more useful in a tight environment. Submitted by: Wilfredo Sanchez <wsanchez@apple.com> Notes: svn path=/head/; revision=40534
* compare return value from getopt against -1 rather than EOF, per the finalWarner Losh1997-03-291-1/+1
| | | | | | | posix standard on the topic. Notes: svn path=/head/; revision=24360
* Finished adjustments for cleaning up declaration of zopen(). Moving theBruce Evans1996-09-051-0/+2
| | | | | | | declaration from <stdio.h> to "zopen.h" left it undeclared here. Notes: svn path=/head/; revision=18053
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-1/+1
| | | | Notes: svn path=/head/; revision=8874
* BSD 4.4 Lite Usr.bin SourcesRodney W. Grimes1994-05-271-0/+444
Notes: svn path=/cvs2svn/branches/CHRISTOS/; revision=1590