httpd: reduce ifdef forest. comment out redundant PATH setting
[oweals/busybox.git] / networking / ifupdown.c
index c1dc1d35d32c20bd6cd263099a425f23bf6093fd..ede2f8997a46980e09a8959ab92dec3cac79500b 100644 (file)
@@ -572,10 +572,7 @@ static char *next_word(char **buf)
        }
 
        /* Skip over leading whitespace */
-       word = *buf;
-       while (isspace(*word)) {
-               ++word;
-       }
+       word = skip_whitespace(*buf);
 
        /* Skip over comments */
        if (*word == '#') {
@@ -649,7 +646,7 @@ static struct interfaces_file_t *read_interfaces(const char *filename)
 
        f = xfopen(filename, "r");
 
-       while ((buf = bb_get_chomped_line_from_file(f)) != NULL) {
+       while ((buf = xmalloc_getline(f)) != NULL) {
                char *buf_ptr = buf;
 
                firstword = next_word(&buf_ptr);
@@ -712,9 +709,7 @@ static struct interfaces_file_t *read_interfaces(const char *filename)
                        }
 
                        /* ship any trailing whitespace */
-                       while (isspace(*buf_ptr)) {
-                               ++buf_ptr;
-                       }
+                       buf_ptr = skip_whitespace(buf_ptr);
 
                        if (buf_ptr[0] != '\0') {
                                bb_error_msg("too many parameters \"%s\"", buf);
@@ -1099,7 +1094,6 @@ int ifupdown_main(int argc, char **argv)
        llist_t *target_list = NULL;
        const char *interfaces = "/etc/network/interfaces";
        int any_failures = 0;
-       int i;
 
        if (applet_name[2] == 'u') {
                /* ifup command */
@@ -1188,6 +1182,7 @@ int ifupdown_main(int argc, char **argv)
                        struct mapping_defn_t *currmap;
 
                        for (currmap = defn->mappings; currmap; currmap = currmap->next) {
+                               int i;
                                for (i = 0; i < currmap->n_matches; i++) {
                                        if (fnmatch(currmap->match[i], liface, 0) != 0)
                                                continue;