]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Trim whitespace between command and argument
authorRoy Marples <roy@marples.name>
Fri, 29 Nov 2013 17:09:37 +0000 (17:09 +0000)
committerRoy Marples <roy@marples.name>
Fri, 29 Nov 2013 17:09:37 +0000 (17:09 +0000)
if-options.c

index 7b90c17273b11b4c50b46cc6b25355b65e86976f..9edd24301511c24cae1f1c735911ebad495cfebf 100644 (file)
@@ -1244,7 +1244,7 @@ parse_option(struct if_options *ifo, int opt, const char *arg)
                }
                /* type */
                fp = strwhite(arg);
-               if (fp) 
+               if (fp)
                        *fp++ = '\0';
                t = 0;
                if (strcasecmp(arg, "request") == 0) {
@@ -1498,6 +1498,8 @@ read_config(const char *file,
                        memcpy(line, *e, ol);
 #endif
                        option = strsep(&line, " \t");
+                       if (line)
+                               line = strskipwhite(line);
                        /* Trim trailing whitespace */
                        if (line && *line) {
                                p = line + strlen(line) - 1;
@@ -1549,6 +1551,8 @@ read_config(const char *file,
 
        while ((line = get_line(f))) {
                option = strsep(&line, " \t");
+               if (line)
+                       line = strskipwhite(line);
                /* Trim trailing whitespace */
                if (line && *line) {
                        p = line + strlen(line) - 1;