summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2004-01-22 18:50:39 +0000
committermillert <millert@openbsd.org>2004-01-22 18:50:39 +0000
commitda15b1c7627593264c10e5dc08e12b91d85647c3 (patch)
treec26de38936e0614c7bdceacab1cdfcb659fecdf2
parentRemove 3 unused variables. (diff)
downloadwireguard-openbsd-da15b1c7627593264c10e5dc08e12b91d85647c3.tar.xz
wireguard-openbsd-da15b1c7627593264c10e5dc08e12b91d85647c3.zip
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.c9
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;
}
}