diff options
Diffstat (limited to 'getopt.c')
-rw-r--r-- | getopt.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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 */ } |