diff options
Diffstat (limited to 'src/util/windows')
-rw-r--r-- | src/util/windows/ChangeLog | 4 | ||||
-rw-r--r-- | src/util/windows/getopt.c | 6 |
2 files changed, 7 insertions, 3 deletions
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 <tytso@rsts-11.mit.edu> + + * 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 != ':') { |