File: diff_as_of_1.07-10.1_getopt.c.patch

package info (click to toggle)
trickle 1.08%2Bds-1.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 584 kB
  • sloc: ansic: 4,923; makefile: 46
file content (54 lines) | stat: -rw-r--r-- 1,578 bytes parent folder | download | duplicates (3)
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 */
 }