Magellan Linux

Diff of /trunk/mkinitrd-magellan/busybox/scripts/basic/fixdep.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 983 by niro, Fri Apr 24 18:33:46 2009 UTC revision 984 by niro, Sun May 30 11:32:42 2010 UTC
# Line 225  void use_config(char *m, int slen) Line 225  void use_config(char *m, int slen)
225  void parse_config_file(char *map, size_t len)  void parse_config_file(char *map, size_t len)
226  {  {
227   /* modified for bbox */   /* modified for bbox */
228   char *end_4 = map + len - 4; /* 4 == length of "USE_" */   char *end_3 = map + len - 3; /* 3 == length of "IF_" */
229   char *end_7 = map + len - 7;   char *end_7 = map + len - 7;
230   char *p = map;   char *p = map;
231   char *q;   char *q;
232   int off;   int off;
233    
234   for (; p < end_4; p++) {   for (; p <= end_3; p++) {
235     /* Find next identifier's beginning */
236     if (!(isalnum(*p) || *p == '_'))
237     continue;
238    
239     /* Check it */
240   if (p < end_7 && p[6] == '_') {   if (p < end_7 && p[6] == '_') {
241   if (!memcmp(p, "CONFIG", 6)) goto conf7;   if (!memcmp(p, "CONFIG", 6)) goto conf7;
242   if (!memcmp(p, "ENABLE", 6)) goto conf7;   if (!memcmp(p, "ENABLE", 6)) goto conf7;
243     if (!memcmp(p, "IF_NOT", 6)) goto conf7;
244   }   }
245   /* We have at least 5 chars: for() has   /* we have at least 3 chars because of p <= end_3 */
246   * "p < end-4", not "p <= end-4"   /*if (!memcmp(p, "IF_", 3)) goto conf3;*/
247   * therefore we don't need to check p <= end-5 here */   if (p[0] == 'I' && p[1] == 'F' && p[2] == '_') goto conf3;
248   if (p[4] == '_')  
249   if (!memcmp(p, "SKIP", 4)) goto conf5;   /* This identifier is not interesting, skip it */
250   /* Ehhh, gcc is too stupid to just compare it as 32bit int */   while (p <= end_3 && (isalnum(*p) || *p == '_'))
251   if (p[0] == 'U')   p++;
  if (!memcmp(p, "USE_", 4)) goto conf4;  
252   continue;   continue;
253    
254   conf4: off = 4;   conf3: off = 3;
  conf5: off = 5;  
255   conf7: off = 7;   conf7: off = 7;
256   p += off;   p += off;
257   for (q = p; q < end_4+4; q++) {   for (q = p; q < end_3+3; q++) {
258   if (!(isalnum(*q) || *q == '_'))   if (!(isalnum(*q) || *q == '_'))
259   break;   break;
260   }   }

Legend:
Removed from v.983  
changed lines
  Added in v.984