1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
Description: Changes to getopt.c as of trickle 1.07-10.1
Rename variable optopt to optcopt, probably due to a name clash
--- trickle-1.07.orig/getopt.c
+++ trickle-1.07/getopt.c
@@ -41,7 +41,7 @@
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 @@
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 @@
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 @@
place = EMSG;
++optind;
}
- return (optopt); /* dump back option letter */
+ return (optcopt); /* dump back option letter */
}
|