From: Roy Marples Date: Fri, 29 Nov 2013 17:09:37 +0000 (+0000) Subject: Trim whitespace between command and argument X-Git-Tag: v6.2.0~34 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ab371aa63bb33d29d363e40d28c5f6f909fdc004;p=thirdparty%2Fdhcpcd.git Trim whitespace between command and argument --- diff --git a/if-options.c b/if-options.c index 7b90c172..9edd2430 100644 --- a/if-options.c +++ b/if-options.c @@ -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;