summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>2002-06-23 20:42:30 +0000
committercharnier <charnier@FreeBSD.org>2002-06-23 20:42:30 +0000
commit136d95b38a8d46de525d872e0c318964b873cfdb (patch)
treee3ed83bbc0a378c1d6821facc5c61dcf04e2f299 /usr.bin
parent99a72e8b2b86de02565bcb2874ef95844f82f8a0 (diff)
downloadFreeBSD-src-136d95b38a8d46de525d872e0c318964b873cfdb.zip
FreeBSD-src-136d95b38a8d46de525d872e0c318964b873cfdb.tar.gz
Make egetopt() return -1 not EOF, as getopt(3) do.
Reviewed by:markm
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/pr/egetopt.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/pr/egetopt.c b/usr.bin/pr/egetopt.c
index 47dd8a1..277459e 100644
--- a/usr.bin/pr/egetopt.c
+++ b/usr.bin/pr/egetopt.c
@@ -93,7 +93,7 @@ egetopt(int nargc, char * const *nargv, const char *ostr)
if ((eoptind >= nargc) ||
((*(place = nargv[eoptind]) != '-') && (*place != '+'))) {
place = emsg;
- return (EOF);
+ return (-1);
}
delim = (int)*place;
@@ -103,7 +103,7 @@ egetopt(int nargc, char * const *nargv, const char *ostr)
*/
++eoptind;
place = emsg;
- return (EOF);
+ return (-1);
}
}
@@ -114,10 +114,10 @@ egetopt(int nargc, char * const *nargv, const char *ostr)
!(oli = strchr(ostr, eoptopt))) {
/*
* if the user didn't specify '-' as an option,
- * assume it means EOF when by itself.
+ * assume it means -1 when by itself.
*/
if ((eoptopt == (int)'-') && !*place)
- return (EOF);
+ return (-1);
if (strchr(ostr, '#') && (isdigit(eoptopt) ||
(((eoptopt == (int)'-') || (eoptopt == (int)'+')) &&
isdigit(*place)))) {
OpenPOWER on IntegriCloud