Commit f36462f0 authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds

[PATCH] Ignore trailing whitespace on kernel parameters correctly

Dave Jones says:

... if the modprobe.conf has trailing whitespace, modules fail to load
with the following helpful message..

	snd_intel8x0: Unknown parameter `'

Previous version truncated last argument.
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Cc: Dave Jones <davej@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e3306dd5
...@@ -80,8 +80,6 @@ static char *next_arg(char *args, char **param, char **val) ...@@ -80,8 +80,6 @@ static char *next_arg(char *args, char **param, char **val)
int in_quote = 0, quoted = 0; int in_quote = 0, quoted = 0;
char *next; char *next;
/* Chew any extra spaces */
while (*args == ' ') args++;
if (*args == '"') { if (*args == '"') {
args++; args++;
in_quote = 1; in_quote = 1;
...@@ -121,6 +119,10 @@ static char *next_arg(char *args, char **param, char **val) ...@@ -121,6 +119,10 @@ static char *next_arg(char *args, char **param, char **val)
next = args + i + 1; next = args + i + 1;
} else } else
next = args + i; next = args + i;
/* Chew up trailing spaces. */
while (*next == ' ')
next++;
return next; return next;
} }
...@@ -135,6 +137,10 @@ int parse_args(const char *name, ...@@ -135,6 +137,10 @@ int parse_args(const char *name,
DEBUGP("Parsing ARGS: %s\n", args); DEBUGP("Parsing ARGS: %s\n", args);
/* Chew leading spaces */
while (*args == ' ')
args++;
while (*args) { while (*args) {
int ret; int ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment