Changeset 2617

Show
Ignore:
Timestamp:
05/22/07 19:25:38 (2 years ago)
Author:
tg
Message:

• typo
• pfeffer also wants comments in the same line

untested

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/freewrt/package/busybox/patches/970-ifupdown-whitespace.patch

    r2615 r2617  
    1 --- busybox-1.4.2/networking/ifupdown.c.old     Tue May 22 16:55:37 2007 
    2 +++ busybox-1.4.2/networking/ifupdown.c.new     Tue May 22 17:02:59 2007 
    3 @@ -656,8 +656,16 @@ static struct interfaces_file_t *read_in 
    4         f = xfopen(filename, "r"); 
     1--- busybox-1.4.2/networking/ifupdown.c.old     Tue May 22 17:22:57 2007 
     2+++ busybox-1.4.2/networking/ifupdown.c Tue May 22 17:23:35 2007 
     3@@ -658,6 +658,51 @@ static struct interfaces_file_t *read_in 
     4        while ((buf = xmalloc_getline(f)) != NULL) { 
     5                char *buf_ptr = buf; 
    56  
    6         while ((buf = xmalloc_getline(f)) != NULL) { 
    7 -               char *buf_ptr = buf; 
    8 +               char *buf_ptr; 
    9   
     7+               /* skip comments -- tg@freewrt.org */ 
     8+               { 
     9+                       unsigned char inquote = 0; 
     10+ skipcommloop: 
     11+                       if (inquote == 0) 
     12+                               switch (*buf_ptr) { 
     13+                               case '\'': 
     14+                               case '\\': 
     15+                               case '"': 
     16+                                       inquote = *buf_ptr; 
     17+                                       break; 
     18+                               case '#': 
     19+                                       *buf_ptr = '\0'; 
     20+                                       goto skipcommend; 
     21+                               } 
     22+                       else if (inquote == '\\') 
     23+                               inquote = 0; 
     24+                       else if ((inquote == '\'') && (*buf_ptr == '\'')) 
     25+                               inquote = 0; 
     26+                       else if (inquote == '"') 
     27+                               switch (*buf_ptr) { 
     28+                               case '"': 
     29+                                       inquote = 0; 
     30+                                       break; 
     31+                               case '\\': 
     32+                                       /* escape one via backslash inside " */ 
     33+                                       inquote = '!'; 
     34+                                       break; 
     35+                               } 
     36+                       else if (inquote == '!') 
     37+                               inquote = '"'; 
     38+                       buf_ptr++; 
     39+                       if (*buf_ptr) 
     40+                               goto skipcommloop; 
     41+ skipcommend:          /* required */; 
     42+               } 
     43
    1044+               /* rtrim -- tg@freewrt.org */ 
    1145+               buf_ptr = buf + strlen(buf) - 1;