summaryrefslogtreecommitdiffstats
path: root/usr.bin/compress
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>1998-10-20 06:13:57 +0000
committermsmith <msmith@FreeBSD.org>1998-10-20 06:13:57 +0000
commit0dac499ae3061d10a40e480f31d75789c090c6a3 (patch)
treed5240be26f93e3223c42ce0b3f0953f55c6a218e /usr.bin/compress
parentab79d507a2af1a9d753d8cc5b7ccbb77a38a6f15 (diff)
downloadFreeBSD-src-0dac499ae3061d10a40e480f31d75789c090c6a3.zip
FreeBSD-src-0dac499ae3061d10a40e480f31d75789c090c6a3.tar.gz
Behave like zcat if invoked as zcat. We don't install as zcat; this just
makes us more useful in a tight environment. Submitted by: Wilfredo Sanchez <wsanchez@apple.com>
Diffstat (limited to 'usr.bin/compress')
-rw-r--r--usr.bin/compress/compress.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/compress/compress.c b/usr.bin/compress/compress.c
index 32d9496..2736e5c 100644
--- a/usr.bin/compress/compress.c
+++ b/usr.bin/compress/compress.c
@@ -75,7 +75,7 @@ main(argc, argv)
int argc;
char *argv[];
{
- enum {COMPRESS, DECOMPRESS} style;
+ enum {COMPRESS, DECOMPRESS} style = COMPRESS;
size_t len;
int bits, cat, ch;
char *p, newname[MAXPATHLEN];
@@ -88,7 +88,10 @@ main(argc, argv)
style = DECOMPRESS;
else if (!strcmp(p, "compress"))
style = COMPRESS;
- else
+ else if (!strcmp(p, "zcat")) {
+ style = DECOMPRESS;
+ cat = 1;
+ } else
errx(1, "unknown program name");
bits = cat = 0;
OpenPOWER on IntegriCloud