diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2005-09-28 06:45:34 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-28 16:46:41 +0200 |
commit | f36462f078403c1859a7e58177b28e01b3a179e4 (patch) | |
tree | 48cc5b800e8fb6701a18135e015ebe57b4f1be60 /kernel/params.c | |
parent | [PATCH] epoll: handle timeout overflow (diff) | |
download | linux-f36462f078403c1859a7e58177b28e01b3a179e4.tar.xz linux-f36462f078403c1859a7e58177b28e01b3a179e4.zip |
[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: Rusty Russell <rusty@rustcorp.com.au>
Cc: Dave Jones <davej@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/params.c')
-rw-r--r-- | kernel/params.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/kernel/params.c b/kernel/params.c index fbf173215fd2..1a8614bac5d5 100644 --- a/kernel/params.c +++ b/kernel/params.c @@ -80,8 +80,6 @@ static char *next_arg(char *args, char **param, char **val) int in_quote = 0, quoted = 0; char *next; - /* Chew any extra spaces */ - while (*args == ' ') args++; if (*args == '"') { args++; in_quote = 1; @@ -121,6 +119,10 @@ static char *next_arg(char *args, char **param, char **val) next = args + i + 1; } else next = args + i; + + /* Chew up trailing spaces. */ + while (*next == ' ') + next++; return next; } @@ -135,6 +137,10 @@ int parse_args(const char *name, DEBUGP("Parsing ARGS: %s\n", args); + /* Chew leading spaces */ + while (*args == ' ') + args++; + while (*args) { int ret; |