summaryrefslogtreecommitdiff
path: root/devel/generate/patches/patch-aa
blob: f9263794902b69de276d6d1016c71ec7caf7f49c (plain)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
$NetBSD: patch-aa,v 1.1 2004/12/18 19:05:54 minskim Exp $

--- generate.c.orig	2004-11-09 14:16:42.000000000 -0600
+++ generate.c
@@ -337,7 +337,7 @@ replace_macro(const char *src, char *dst
 		for (k = 0; k < 10; k++)
 			param[k] = "";
 
-		if (isdigit(*buf))
+		if (isdigit((unsigned char)*buf))
 		{
 			if (buf[1] && buf[1] != ':')
 				fatal("Invalid macro call");
@@ -380,25 +380,25 @@ replace_macro(const char *src, char *dst
 
 			for (ptr = calcbuf; *ptr;)
 			{
-				while (isspace(*ptr))
+				while (isspace((unsigned char)*ptr))
 					ptr++;
 
-				if (!isdigit(*ptr))
+				if (!isdigit((unsigned char)*ptr))
 					fatal("Invalid digit");
 
 				num = strtol(ptr, &ptr, 0);
 
-				while (isspace(*ptr))
+				while (isspace((unsigned char)*ptr))
 					ptr++;
 
 				if (*ptr == '-')
 				{
 					ptr++;
 
-					while (isspace(*ptr))
+					while (isspace((unsigned char)*ptr))
 						ptr++;
 
-					if (!isdigit(*ptr))
+					if (!isdigit((unsigned char)*ptr))
 						fatal("Invalid expression");
 
 					to = strtol(ptr, &ptr, 0);
@@ -429,7 +429,7 @@ replace_macro(const char *src, char *dst
 
 			replace_macro(buf + 2, calcbuf, pre_param);
 			e1 = calcbuf;
-			while (isspace(*e1))
+			while (isspace((unsigned char)*e1))
 				e1++;
 
 			e2 = e1;
@@ -443,7 +443,7 @@ replace_macro(const char *src, char *dst
 
 			if (*e2)
 			(*e2++ = 0);
-			while (isspace(*e2))
+			while (isspace((unsigned char)*e2))
 				e2++;
 
 			e3 = e2;
@@ -475,7 +475,7 @@ replace_macro(const char *src, char *dst
 			{
 				*p++ = 0;
 
-				while (isspace(*p))
+				while (isspace((unsigned char)*p))
 					p++;
 
 				param[k++] = p;
@@ -737,10 +737,10 @@ find_key(char *s)
 	else
 		return (-1);
 
-	if (*p && !isspace(*p))
+	if (*p && !isspace((unsigned char)*p))
 		return (-1);
 
-	while (isspace(*p))
+	while (isspace((unsigned char)*p))
 		p++;
 
 	strcpy(s, p);
@@ -769,13 +769,13 @@ make_path(char *p)
 static char    *
 split_line(char *s)
 {
-	while (*s && !isspace(*s))
+  while (*s && !isspace((unsigned char)*s))
 		s++;
 
 	if (*s)
 		*s++ = 0;
 
-	while (isspace(*s))
+	while (isspace((unsigned char)*s))
 		s++;
 
 	return (s);
@@ -822,7 +822,7 @@ get_input(FILE * in_fp, int if_flag)
 		p = pp;
 		sprintf(cur_line_str, "%d", xline);
 
-		while (isspace(*p))
+		while (isspace((unsigned char)*p))
 			p++;
 
 		if (!*p)
@@ -842,7 +842,7 @@ get_input(FILE * in_fp, int if_flag)
 		}
 
 		/* undocumented - probably unneeded */
-		if (!p[1] || isspace(p[1]))		/* comment */
+		if (!p[1] || isspace((unsigned char)p[1]))		/* comment */
 			continue;
 
 		if ((cmd = find_key(p)) == AT_ENDIF)
@@ -1129,7 +1129,7 @@ get_input(FILE * in_fp, int if_flag)
 
 				for (; *p; p = q)
 				{
-					while (*p && isspace(*p))
+				  while (*p && isspace((unsigned char)*p))
 						p++;
 
 					if (*p == '\'' || *p == '"')