X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/ed554bc5e4201344d7eaad78263566e79428759c..fd88f5c5678c80ff5e338adc372d28a52ad20530:/usr/src/lib/libc/stdlib/getopt.c diff --git a/usr/src/lib/libc/stdlib/getopt.c b/usr/src/lib/libc/stdlib/getopt.c index 994d757533..5dddf86072 100644 --- a/usr/src/lib/libc/stdlib/getopt.c +++ b/usr/src/lib/libc/stdlib/getopt.c @@ -32,7 +32,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)getopt.c 8.2 (Berkeley) 4/2/94"; +static char sccsid[] = "@(#)getopt.c 8.3 (Berkeley) 4/27/95"; #endif /* LIBC_SCCS and not lint */ #include @@ -67,22 +67,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 != ':')