Skip to content

Commit

Permalink
[PATCH] Ignore trailing whitespace on kernel parameters correctly
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rusty Russell authored and Linus Torvalds committed Sep 28, 2005
1 parent e3306dd commit f36462f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions kernel/params.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand All @@ -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;

Expand Down

0 comments on commit f36462f

Please sign in to comment.