diff options
author | Peter Oberparleiter <oberpar@linux.vnet.ibm.com> | 2009-07-06 17:11:22 +0200 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2009-09-25 00:32:58 +0930 |
commit | 26d052bfce799ef0e7262695b46e3525ca4d381d (patch) | |
tree | 4244565b8a687f52fa2b7375cc8435fd1bb41e98 /kernel | |
parent | 554bdfe5acf3715e87c8d5e25a4f9a896ac9f014 (diff) | |
download | lwn-26d052bfce799ef0e7262695b46e3525ca4d381d.tar.gz lwn-26d052bfce799ef0e7262695b46e3525ca4d381d.zip |
param: allow whitespace as kernel parameter separator
Some boot mechanisms require that kernel parameters are stored in a
separate file which is loaded to memory without further processing
(e.g. the "Load from FTP" method on s390). When such a file contains
newline characters, the kernel parameter preceding the newline might
not be correctly parsed (due to the newline being stuck to the end of
the actual parameter value) which can lead to boot failures.
This patch improves kernel command line usability in such a situation
by allowing generic whitespace characters as separators between kernel
parameters.
Signed-off-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/params.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/params.c b/kernel/params.c index 7f6912ced2ba..9da58eabdcb2 100644 --- a/kernel/params.c +++ b/kernel/params.c @@ -23,6 +23,7 @@ #include <linux/device.h> #include <linux/err.h> #include <linux/slab.h> +#include <linux/ctype.h> #if 0 #define DEBUGP printk @@ -87,7 +88,7 @@ static char *next_arg(char *args, char **param, char **val) } for (i = 0; args[i]; i++) { - if (args[i] == ' ' && !in_quote) + if (isspace(args[i]) && !in_quote) break; if (equals == 0) { if (args[i] == '=') @@ -121,7 +122,7 @@ static char *next_arg(char *args, char **param, char **val) next = args + i; /* Chew up trailing spaces. */ - while (*next == ' ') + while (isspace(*next)) next++; return next; } @@ -138,7 +139,7 @@ int parse_args(const char *name, DEBUGP("Parsing ARGS: %s\n", args); /* Chew leading spaces */ - while (*args == ' ') + while (isspace(*args)) args++; while (*args) { |