diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2004-01-22 18:50:40 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2004-01-22 18:50:40 +0000 |
commit | 6cdaf7fdfeecbb521f4cf141d85ac7f0de778639 (patch) | |
tree | 31933595cb00c214aee7e3321fb0e222642e2099 | |
parent | 129a86578c81e48e7fe834595035ffab321b6306 (diff) |
Make exit code for "unknown suffix" and "name too long" match GNU gzip.
Fixes an interaction with the perl CPAN module which checks the exit value.
-rw-r--r-- | usr.bin/compress/main.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/compress/main.c b/usr.bin/compress/main.c index d1ffb407076..7894dfde8cf 100644 --- a/usr.bin/compress/main.c +++ b/usr.bin/compress/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.52 2003/12/16 23:32:24 henning Exp $ */ +/* $OpenBSD: main.c,v 1.53 2004/01/22 18:50:39 millert Exp $ */ #ifndef SMALL static const char copyright[] = @@ -36,7 +36,7 @@ static const char license[] = #endif /* SMALL */ #ifndef SMALL -static const char main_rcsid[] = "$OpenBSD: main.c,v 1.52 2003/12/16 23:32:24 henning Exp $"; +static const char main_rcsid[] = "$OpenBSD: main.c,v 1.53 2004/01/22 18:50:39 millert Exp $"; #endif #include <sys/param.h> @@ -386,9 +386,11 @@ main(int argc, char *argv[]) if (decomp) { if (set_outfile(infile, outfile, sizeof outfile) == NULL) { - if (!recurse) + if (!recurse) { warnx("%s: unknown suffix: " "ignored", infile); + rc = rc ? rc : WARNING; + } continue; } } else { @@ -396,6 +398,7 @@ main(int argc, char *argv[]) "%s%s", infile, suffix) >= sizeof(outfile)) { warnx("%s%s: name too long", infile, suffix); + rc = rc ? rc : WARNING; continue; } } |