summaryrefslogtreecommitdiffstats
path: root/src/util/windows
diff options
context:
space:
mode:
authorTheodore Tso <tytso@mit.edu>1998-05-06 20:24:10 +0000
committerTheodore Tso <tytso@mit.edu>1998-05-06 20:24:10 +0000
commitdf85cc01656c2a234642047ea22b44b5f6a65683 (patch)
treec8eb10be62668ae2cde30336430d8145a3d30df3 /src/util/windows
parent376a54c9f64fbb57813e5902bd46ed63e9b2c746 (diff)
downloadkrb5-df85cc01656c2a234642047ea22b44b5f6a65683.tar.gz
krb5-df85cc01656c2a234642047ea22b44b5f6a65683.tar.xz
krb5-df85cc01656c2a234642047ea22b44b5f6a65683.zip
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
Diffstat (limited to 'src/util/windows')
-rw-r--r--src/util/windows/ChangeLog4
-rw-r--r--src/util/windows/getopt.c6
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 != ':') {