From df85cc01656c2a234642047ea22b44b5f6a65683 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Wed, 6 May 1998 20:24:10 +0000 Subject: POSIX states that getopt returns -1 when it is done parsing options, not EOF. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10550 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/windows/ChangeLog | 4 ++++ src/util/windows/getopt.c | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src/util/windows') diff --git a/src/util/windows/ChangeLog b/src/util/windows/ChangeLog index e69de29bb2..0484dd08a1 100644 --- a/src/util/windows/ChangeLog +++ b/src/util/windows/ChangeLog @@ -0,0 +1,4 @@ +1998-05-06 Theodore Ts'o + + * getopt.c (getopt): POSIX states that getopt returns -1 + when it is done parsing options, not EOF. diff --git a/src/util/windows/getopt.c b/src/util/windows/getopt.c index ee38e72abe..081520f559 100644 --- a/src/util/windows/getopt.c +++ b/src/util/windows/getopt.c @@ -67,12 +67,12 @@ 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)':' || @@ -82,7 +82,7 @@ getopt(nargc, nargv, ostr) * assume it means EOF. */ if (optopt == (int)'-') - return(EOF); + return(-1); if (!*place) ++optind; if (opterr && *ostr != ':') { -- cgit