Changeset 2725 in MondoRescue for branches/2.2.9/mindi-busybox/scripts/basic
- Timestamp:
- Feb 25, 2011, 9:26:54 PM (13 years ago)
- Location:
- branches/2.2.9/mindi-busybox/scripts/basic
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mindi-busybox/scripts/basic/docproc.c
r1765 r2725 80 80 pid_t pid; 81 81 int ret; 82 char real_filename[PATH_MAX + 1]; 82 char *real_filename; 83 int rflen; 84 83 85 /* Make sure output generated so far are flushed */ 84 86 fflush(stdout); 85 87 switch(pid=fork()) { 86 88 case -1: 87 perror(" fork");89 perror("vfork"+1); 88 90 exit(1); 89 91 case 0: 90 memset(real_filename, 0, sizeof(real_filename)); 91 strncat(real_filename, getenv("SRCTREE"), PATH_MAX); 92 strncat(real_filename, KERNELDOCPATH KERNELDOC, 93 PATH_MAX - strlen(real_filename)); 92 rflen = strlen(getenv("SRCTREE")); 93 rflen += strlen(KERNELDOCPATH KERNELDOC); 94 real_filename = alloca(rflen + 1); 95 strcpy(real_filename, getenv("SRCTREE")); 96 strcat(real_filename, KERNELDOCPATH KERNELDOC); 94 97 execvp(real_filename, svec); 95 98 fprintf(stderr, "exec "); … … 167 170 char line[MAXLINESZ]; 168 171 if (filename_exist(filename) == NULL) { 169 char real_filename[PATH_MAX + 1]; 170 memset(real_filename, 0, sizeof(real_filename)); 171 strncat(real_filename, getenv("SRCTREE"), PATH_MAX); 172 strncat(real_filename, filename, 173 PATH_MAX - strlen(real_filename)); 172 int rflen = strlen(getenv("SRCTREE")) + strlen(filename); 173 char *real_filename = alloca(rflen + 1); 174 strcpy(real_filename, getenv("SRCTREE")); 175 strcat(real_filename, filename); 174 176 sym = add_new_file(filename); 175 177 fp = fopen(real_filename, "r"); … … 250 252 251 253 /* 252 * Document sp åecific function(s) in a file.254 * Document specific function(s) in a file. 253 255 * Call kernel-doc with the following parameters: 254 256 * kernel-doc -docbook -function function1 [-function function2] … … 396 398 return exitstatus; 397 399 } 398 -
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); -
branches/2.2.9/mindi-busybox/scripts/basic/split-include.c
r1765 r2725 111 111 if (line[0] != '#') 112 112 continue; 113 if ((str_config = strstr(line, " CONFIG_")) == NULL)113 if ((str_config = strstr(line, " CONFIG_")) == NULL) 114 114 continue; 115 115 116 /* Make the output file name. */ 117 str_config += sizeof("CONFIG_") - 1; 116 /* We found #define CONFIG_foo or #undef CONFIG_foo. 117 * Make the output file name. */ 118 str_config += sizeof(" CONFIG_") - 1; 118 119 for (itarget = 0; !isspace(str_config[itarget]); itarget++) 119 120 { … … 155 156 156 157 /* Write the file. */ 157 if ((fp_target = fopen(ptarget, "w")) == NULL)158 if ((fp_target = fopen(ptarget, "w")) == NULL) 158 159 ERROR_EXIT(ptarget); 159 160 fputs(line, fp_target);
Note:
See TracChangeset
for help on using the changeset viewer.