summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1998-09-29 04:56:30 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1998-09-29 04:56:30 +0000
commit799860170639a9b47268a5da4645d2c66e526643 (patch)
treee1d3bfc4f1ff36e158a4cdb045fe1bcce97e35d7
parent81e30e2649caf24f1ca3f41d08eab4a19bb1287d (diff)
Notes
-rw-r--r--lib/libz/minigzip.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/libz/minigzip.c b/lib/libz/minigzip.c
index 7ba1666cbe4f..487632e7f1d2 100644
--- a/lib/libz/minigzip.c
+++ b/lib/libz/minigzip.c
@@ -270,15 +270,25 @@ int main(argc, argv)
{
int uncompr = 0;
gzFile file;
- char outmode[20];
+ char *bname, outmode[20];
strcpy(outmode, "wb6 ");
prog = argv[0];
+ bname = strrchr(argv[0], '/');
+ if (bname)
+ bname++;
+ else
+ bname = argv[0];
argc--, argv++;
+ if (!strcmp(bname, "gunzip") || !strcmp(bname, "zcat"))
+ uncompr = 1;
+
while (argc > 0) {
- if (strcmp(*argv, "-d") == 0)
+ if (strcmp(*argv, "-c") == 0)
+ ; /* Just for compatability with gzip */
+ else if (strcmp(*argv, "-d") == 0)
uncompr = 1;
else if (strcmp(*argv, "-f") == 0)
outmode[3] = 'f';