Changeset 2725 in MondoRescue for branches/2.2.9/mindi-busybox/scripts/basic/fixdep.c
- Timestamp:
- Feb 25, 2011, 9:26:54 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mindi-busybox/scripts/basic/fixdep.c
r1765 r2725 204 204 void use_config(char *m, int slen) 205 205 { 206 char s[PATH_MAX];206 char *s = alloca(slen+1); 207 207 char *p; 208 208 … … 226 226 { 227 227 /* modified for bbox */ 228 char *end_ 4 = map + len - 4; /* 4 == length of "USE_" */228 char *end_3 = map + len - 3; /* 3 == length of "IF_" */ 229 229 char *end_7 = map + len - 7; 230 230 char *p = map; … … 232 232 int off; 233 233 234 for (; p < end_4; p++) { 234 for (; p <= end_3; p++) { 235 /* Find next identifier's beginning */ 236 if (!(isalnum(*p) || *p == '_')) 237 continue; 238 239 /* Check it */ 235 240 if (p < end_7 && p[6] == '_') { 236 241 if (!memcmp(p, "CONFIG", 6)) goto conf7; 237 242 if (!memcmp(p, "ENABLE", 6)) goto conf7; 238 } 239 /* We have at least 5 chars: for() has 240 * "p < end-4", not "p <= end-4" 241 * therefore we don't need to check p <= end-5 here */ 242 if (p[4] == '_') 243 if (!memcmp(p, "SKIP", 4)) goto conf5; 244 /* Ehhh, gcc is too stupid to just compare it as 32bit int */ 245 if (p[0] == 'U') 246 if (!memcmp(p, "USE_", 4)) goto conf4; 243 if (!memcmp(p, "IF_NOT", 6)) goto conf7; 244 } 245 /* we have at least 3 chars because of p <= end_3 */ 246 /*if (!memcmp(p, "IF_", 3)) ...*/ 247 if (p[0] == 'I' && p[1] == 'F' && p[2] == '_') { 248 off = 3; 249 goto conf; 250 } 251 252 /* This identifier is not interesting, skip it */ 253 while (p <= end_3 && (isalnum(*p) || *p == '_')) 254 p++; 247 255 continue; 248 256 249 conf4: off = 4;250 conf5: off = 5;251 257 conf7: off = 7; 258 conf: 252 259 p += off; 253 for (q = p; q < end_ 4+4; q++) {260 for (q = p; q < end_3+3; q++) { 254 261 if (!(isalnum(*q) || *q == '_')) 255 262 break; 256 263 } 257 use_config(p, q-p); 264 if (q != p) { 265 use_config(p, q-p); 266 } 258 267 } 259 268 } … … 307 316 char *end = m + len; 308 317 char *p; 309 char s[PATH_MAX];318 char *s = alloca(len); 310 319 311 320 p = memchr(m, ':', len);
Note:
See TracChangeset
for help on using the changeset viewer.