summaryrefslogtreecommitdiffstats
path: root/src/util
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
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')
-rw-r--r--src/util/db2/test/ChangeLog5
-rw-r--r--src/util/db2/test/btree.tests/ChangeLog4
-rw-r--r--src/util/db2/test/btree.tests/main.c2
-rw-r--r--src/util/db2/test/dbtest.c2
-rw-r--r--src/util/windows/ChangeLog4
-rw-r--r--src/util/windows/getopt.c6
6 files changed, 18 insertions, 5 deletions
diff --git a/src/util/db2/test/ChangeLog b/src/util/db2/test/ChangeLog
new file mode 100644
index 0000000000..4e147d7466
--- /dev/null
+++ b/src/util/db2/test/ChangeLog
@@ -0,0 +1,5 @@
+1998-05-06 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * dbtest.c (main): POSIX states that getopt returns -1
+ when it is done parsing options, not EOF.
+
diff --git a/src/util/db2/test/btree.tests/ChangeLog b/src/util/db2/test/btree.tests/ChangeLog
new file mode 100644
index 0000000000..cfd0b18a2f
--- /dev/null
+++ b/src/util/db2/test/btree.tests/ChangeLog
@@ -0,0 +1,4 @@
+1998-05-06 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * main.c (main): POSIX states that getopt returns -1
+ when it is done parsing options, not EOF.
diff --git a/src/util/db2/test/btree.tests/main.c b/src/util/db2/test/btree.tests/main.c
index 61c9731cc9..bbf1fcfacb 100644
--- a/src/util/db2/test/btree.tests/main.c
+++ b/src/util/db2/test/btree.tests/main.c
@@ -135,7 +135,7 @@ main(argc, argv)
b.prefix = NULL;
b.lorder = 0;
- while ((c = getopt(argc, argv, "bc:di:lp:ru")) != EOF) {
+ while ((c = getopt(argc, argv, "bc:di:lp:ru")) != -1) {
switch (c) {
case 'b':
b.lorder = BIG_ENDIAN;
diff --git a/src/util/db2/test/dbtest.c b/src/util/db2/test/dbtest.c
index 170a0ea0f7..f499047ae9 100644
--- a/src/util/db2/test/dbtest.c
+++ b/src/util/db2/test/dbtest.c
@@ -101,7 +101,7 @@ main(argc, argv)
fname = NULL;
oflags = O_CREAT | O_RDWR | O_BINARY;
sflag = 0;
- while ((ch = getopt(argc, argv, "f:i:lo:s")) != EOF)
+ while ((ch = getopt(argc, argv, "f:i:lo:s")) != -1)
switch (ch) {
case 'f':
fname = optarg;
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 != ':') {