summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib/getopt.c
diff options
context:
space:
mode:
authorjtc <jtc@NetBSD.org>1994-05-06 18:18:33 +0000
committerjtc <jtc@NetBSD.org>1994-05-06 18:18:33 +0000
commita5284b9db48ff1e578eee29970845be83e0f540b (patch)
treea31566ab5fcc58b94817d8dcee73463b39390228 /lib/libc/stdlib/getopt.c
parent34ae5e111cdb9c6ed290538ba473ad2f167f8f2b (diff)
merge back in our changes (mostly POSIX.2 pedanticism)
Diffstat (limited to 'lib/libc/stdlib/getopt.c')
-rw-r--r--lib/libc/stdlib/getopt.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/libc/stdlib/getopt.c b/lib/libc/stdlib/getopt.c
index 994d757533e..561f4623a7f 100644
--- a/lib/libc/stdlib/getopt.c
+++ b/lib/libc/stdlib/getopt.c
@@ -32,7 +32,8 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getopt.c 8.2 (Berkeley) 4/2/94";
+/* static char sccsid[] = "from: @(#)getopt.c 8.2 (Berkeley) 4/2/94"; */
+static char *rcsid = "$Id: getopt.c,v 1.7 1994/05/06 18:18:35 jtc Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
@@ -67,22 +68,22 @@ getopt(nargc, nargv, ostr)
optreset = 0;
if (optind >= nargc || *(place = nargv[optind]) != '-') {
place = EMSG;
- return (EOF);
+ return (-1);
}
if (place[1] && *++place == '-') { /* found "--" */
++optind;
place = EMSG;
- return (EOF);
+ return (-1);
}
} /* option letter okay? */
if ((optopt = (int)*place++) == (int)':' ||
!(oli = strchr(ostr, optopt))) {
/*
* if the user didn't specify '-' as an option,
- * assume it means EOF.
+ * assume it means -1.
*/
if (optopt == (int)'-')
- return (EOF);
+ return (-1);
if (!*place)
++optind;
if (opterr && *ostr != ':')