diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1999-05-23 17:37:42 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1999-05-23 17:37:42 +0000 |
commit | da75ad8aa2c2074f25be0998a13903f44f77e000 (patch) | |
tree | a39a82cc5d5ed2a061ebae10ef6998094c1c65a4 /usr.bin/pr | |
parent | 5d08734a5b3d621dfd1d78fa4e113f91bde28818 (diff) |
make private version of getopt() return -1, not EOF
Diffstat (limited to 'usr.bin/pr')
-rw-r--r-- | usr.bin/pr/egetopt.c | 10 | ||||
-rw-r--r-- | usr.bin/pr/pr.c | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/usr.bin/pr/egetopt.c b/usr.bin/pr/egetopt.c index cbff00cbcae..08b365adcb3 100644 --- a/usr.bin/pr/egetopt.c +++ b/usr.bin/pr/egetopt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: egetopt.c,v 1.2 1996/06/26 05:37:52 deraadt Exp $ */ +/* $OpenBSD: egetopt.c,v 1.3 1999/05/23 17:37:41 millert Exp $ */ /*- * Copyright (c) 1991 Keith Muller. @@ -39,7 +39,7 @@ #ifndef lint /* from: static char sccsid[] = "@(#)egetopt.c 8.1 (Berkeley) 6/6/93"; */ -static char *rcsid = "$OpenBSD: egetopt.c,v 1.2 1996/06/26 05:37:52 deraadt Exp $"; +static char *rcsid = "$OpenBSD: egetopt.c,v 1.3 1999/05/23 17:37:41 millert Exp $"; #endif /* not lint */ #include <ctype.h> @@ -93,7 +93,7 @@ egetopt(nargc, nargv, ostr) if ((eoptind >= nargc) || ((*(place = nargv[eoptind]) != '-') && (*place != '+'))) { place = EMSG; - return (EOF); + return (-1); } delim = (int)*place; @@ -103,7 +103,7 @@ egetopt(nargc, nargv, ostr) */ ++eoptind; place = EMSG; - return (EOF); + return (-1); } } @@ -117,7 +117,7 @@ egetopt(nargc, nargv, ostr) * assume it means EOF when by itself. */ if ((eoptopt == (int)'-') && !*place) - return (EOF); + return (-1); if (strchr(ostr, '#') && (isdigit(eoptopt) || (((eoptopt == (int)'-') || (eoptopt == (int)'+')) && isdigit(*place)))) { diff --git a/usr.bin/pr/pr.c b/usr.bin/pr/pr.c index 2bed7398e5d..de7836aefb4 100644 --- a/usr.bin/pr/pr.c +++ b/usr.bin/pr/pr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pr.c,v 1.5 1997/04/23 08:08:28 grr Exp $ */ +/* $OpenBSD: pr.c,v 1.6 1999/05/23 17:37:41 millert Exp $ */ /*- * Copyright (c) 1991 Keith Muller. @@ -45,7 +45,7 @@ static char copyright[] = #ifndef lint /* from: static char sccsid[] = "@(#)pr.c 8.1 (Berkeley) 6/6/93"; */ -static char *rcsid = "$OpenBSD: pr.c,v 1.5 1997/04/23 08:08:28 grr Exp $"; +static char *rcsid = "$OpenBSD: pr.c,v 1.6 1999/05/23 17:37:41 millert Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -1078,7 +1078,7 @@ inln(inf, buf, lim, cnt, cps, trnc, mor) { register int col; register int gap = ingap; - register int ch = EOF; + register int ch = -1; register char *ptbuf; register int chk = (int)inchar; @@ -1757,7 +1757,7 @@ setup(argc, argv) } } else err = stderr; - while ((c = egetopt(argc, argv, "#adfFmrte?h:i?l:n?o:s?w:")) != EOF) { + while ((c = egetopt(argc, argv, "#adfFmrte?h:i?l:n?o:s?w:")) != -1) { switch (c) { case '+': if ((pgnm = atoi(eoptarg)) < 1) { |