aboutsummaryrefslogtreecommitdiff
path: root/getopt.c
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-12-23 04:30:36 -0500
committerB. Watson <urchlay@slackware.uk>2024-12-23 04:30:36 -0500
commit404892de8d87dc68fc0882844d69911fb04f6df5 (patch)
treebda54f753b8f3a796fd1d89625b758e8a58ca9f7 /getopt.c
parent1ca75efcaa18be049070220a40f921d7023c790e (diff)
downloaduxd-404892de8d87dc68fc0882844d69911fb04f6df5.tar.gz
rename optopt
Diffstat (limited to 'getopt.c')
-rw-r--r--getopt.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/getopt.c b/getopt.c
index 8a23548..39d5c9a 100644
--- a/getopt.c
+++ b/getopt.c
@@ -48,11 +48,11 @@ static char *index (char *s, int c) {
*/
int opterr = 1, /* useless, never set or used */
my_optind = 1, /* index into parent argv vector */
- optopt; /* character checked for validity */
+ my_optopt; /* character checked for validity */
char *my_optarg; /* argument associated with option */
#define tell(s) fprintf(stderr, "%s: %s", self, s); \
- fputc(optopt,stderr);fputs(" (use -h for help)\n",stderr);return(BADCH);
+ fputc(my_optopt,stderr);fputs(" (use -h for help)\n",stderr);return(BADCH);
int my_getopt(int nargc, char **nargv, char *ostr) {
@@ -66,7 +66,7 @@ int my_getopt(int nargc, char **nargv, char *ostr) {
return(EOF);
}
} /* option letter okay? */
- if ((optopt = (int)*place++) == ARGCH || !(oli = index(ostr,optopt))) {
+ if ((my_optopt = (int)*place++) == ARGCH || !(oli = index(ostr,my_optopt))) {
if(!*place) ++my_optind;
tell("illegal option: -");
}
@@ -84,6 +84,6 @@ int my_getopt(int nargc, char **nargv, char *ostr) {
place = EMSG;
++my_optind;
}
- return(optopt); /* dump back option letter */
+ return(my_optopt); /* dump back option letter */
}