From 404892de8d87dc68fc0882844d69911fb04f6df5 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Mon, 23 Dec 2024 04:30:36 -0500 Subject: rename optopt --- getopt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'getopt.c') 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 */ } -- cgit v1.2.3