aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorRandy Dunlap <rddunlap@osdl.org>2005-01-04 05:26:05 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-04 05:26:05 -0800
commit08ccfcc14c06015f62144b309ceab92abf510bd6 (patch)
tree3fc046a680c4b4cdb900da6283983d38ac2ad6b6 /kernel
parent8c42b547e53e4b9b5810afdc849126b08cd319e5 (diff)
downloadhistory-08ccfcc14c06015f62144b309ceab92abf510bd6.tar.gz
[PATCH] handle quoted module parameters
Fix module parameter quote handling. Module parameter strings (with spaces) are quoted like so: "modprm=this test" and not like this: modprm="this test" Signed-off-by: Randy Dunlap <rddunlap@osdl.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/params.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/kernel/params.c b/kernel/params.c
index 45dd451e17c169..accec1a481afe6 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -77,10 +77,16 @@ static int parse_one(char *param,
static char *next_arg(char *args, char **param, char **val)
{
unsigned int i, equals = 0;
- int in_quote = 0;
+ int in_quote = 0, quoted = 0;
+ char *next;
/* Chew any extra spaces */
while (*args == ' ') args++;
+ if (*args == '"') {
+ args++;
+ in_quote = 1;
+ quoted = 1;
+ }
for (i = 0; args[i]; i++) {
if (args[i] == ' ' && !in_quote)
@@ -106,13 +112,16 @@ static char *next_arg(char *args, char **param, char **val)
if (args[i-1] == '"')
args[i-1] = '\0';
}
+ if (quoted && args[i-1] == '"')
+ args[i-1] = '\0';
}
if (args[i]) {
args[i] = '\0';
- return args + i + 1;
+ next = args + i + 1;
} else
- return args + i;
+ next = args + i;
+ return next;
}
/* Args looks like "foo=bar,bar2 baz=fuz wiz". */