summaryrefslogtreecommitdiffstats
path: root/bin/pax/getoldopt.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2010-03-30 23:14:35 +0000
committerdelphij <delphij@FreeBSD.org>2010-03-30 23:14:35 +0000
commitb5856ffe18a90a307588b04c40542c50ceeef8fa (patch)
treeb17d6ecf2ca179c716ab87cb6829b3761da13115 /bin/pax/getoldopt.c
parentad0f267ec8b0b93d570314a3cfd99de391cb0e5a (diff)
downloadFreeBSD-src-b5856ffe18a90a307588b04c40542c50ceeef8fa.zip
FreeBSD-src-b5856ffe18a90a307588b04c40542c50ceeef8fa.tar.gz
Merge OpenBSD revisions 1.4 through 1.9, mostly style cleanups.
Obtained from: OpenBSD MFC after: 3 month
Diffstat (limited to 'bin/pax/getoldopt.c')
-rw-r--r--bin/pax/getoldopt.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/bin/pax/getoldopt.c b/bin/pax/getoldopt.c
index 1c9f63c..2871721 100644
--- a/bin/pax/getoldopt.c
+++ b/bin/pax/getoldopt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getoldopt.c,v 1.4 2000/01/22 20:24:51 deraadt Exp $ */
+/* $OpenBSD: getoldopt.c,v 1.9 2009/10/27 23:59:22 deraadt Exp $ */
/* $NetBSD: getoldopt.c,v 1.3 1995/03/21 09:07:28 cgd Exp $ */
/*-
@@ -7,7 +7,7 @@
* otherwise, it uses the old rules used by tar, dump, and ps.
*
* Written 25 August 1985 by John Gilmore (ihnp4!hoptoad!gnu) and placed
- * in the Pubic Domain for your edification and enjoyment.
+ * in the Public Domain for your edification and enjoyment.
*/
#include <sys/cdefs.h>
@@ -33,7 +33,8 @@ getoldopt(int argc, char **argv, const char *optstring)
optarg = NULL;
if (key == NULL) { /* First time */
- if (argc < 2) return EOF;
+ if (argc < 2)
+ return (-1);
key = argv[1];
if (*key == '-')
use_getopt++;
@@ -42,18 +43,18 @@ getoldopt(int argc, char **argv, const char *optstring)
}
if (use_getopt)
- return getopt(argc, argv, optstring);
+ return (getopt(argc, argv, optstring));
c = *key++;
if (c == '\0') {
key--;
- return EOF;
+ return (-1);
}
place = strchr(optstring, c);
if (place == NULL || c == ':') {
fprintf(stderr, "%s: unknown option %c\n", argv[0], c);
- return('?');
+ return ('?');
}
place++;
@@ -64,9 +65,9 @@ getoldopt(int argc, char **argv, const char *optstring)
} else {
fprintf(stderr, "%s: %c argument missing\n",
argv[0], c);
- return('?');
+ return ('?');
}
}
- return(c);
+ return (c);
}
OpenPOWER on IntegriCloud