X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=kernel%2Fparams.c;h=1a8614bac5d5c819110ae67bd21efca75845b600;hb=f36462f078403c1859a7e58177b28e01b3a179e4;hp=fbf173215fd217bed3db643ba0676916f7085daf;hpb=e3306dd5f7eb2e699f36a4a313fca4b48b18d5e1;p=~andy%2Flinux diff --git a/kernel/params.c b/kernel/params.c index fbf173215fd..1a8614bac5d 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;