summaryrefslogtreecommitdiff
path: root/getopt.c
diff options
context:
space:
mode:
Diffstat (limited to 'getopt.c')
-rw-r--r--getopt.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/getopt.c b/getopt.c
index b7f6163..dd87891 100644
--- a/getopt.c
+++ b/getopt.c
@@ -41,7 +41,7 @@ static char *rcsid = "$OpenBSD: getopt.c,v 1.2 1996/08/19 08:33:32 tholo Exp $";
int opterr = 1, /* if error message should be printed */
optind = 1, /* index into parent argv vector */
- optopt, /* character checked for validity */
+ optcopt, /* character checked for validity */
optreset; /* reset getopt */
char *optarg; /* argument associated with option */
@@ -75,19 +75,19 @@ getopt(nargc, nargv, ostr)
return (-1);
}
} /* option letter okay? */
- if ((optopt = (int)*place++) == (int)':' ||
- !(oli = strchr(ostr, optopt))) {
+ if ((optcopt = (int)*place++) == (int)':' ||
+ !(oli = strchr(ostr, optcopt))) {
/*
* if the user didn't specify '-' as an option,
* assume it means -1.
*/
- if (optopt == (int)'-')
+ if (optcopt == (int)'-')
return (-1);
if (!*place)
++optind;
if (opterr && *ostr != ':')
(void)fprintf(stderr,
- "%s: illegal option -- %c\n", __progname, optopt);
+ "%s: illegal option -- %c\n", __progname, optcopt);
return (BADCH);
}
if (*++oli != ':') { /* don't need argument */
@@ -105,7 +105,7 @@ getopt(nargc, nargv, ostr)
if (opterr)
(void)fprintf(stderr,
"%s: option requires an argument -- %c\n",
- __progname, optopt);
+ __progname, optcopt);
return (BADCH);
}
else /* white space */
@@ -113,5 +113,5 @@ getopt(nargc, nargv, ostr)
place = EMSG;
++optind;
}
- return (optopt); /* dump back option letter */
+ return (optcopt); /* dump back option letter */
}