Merge branch 'master'
[pandora-kernel.git] / kernel / params.c
index fbf1732..47ba695 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/module.h>
 #include <linux/device.h>
 #include <linux/err.h>
+#include <linux/slab.h>
 
 #if 0
 #define DEBUGP printk
@@ -80,8 +81,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 +120,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 +138,10 @@ int parse_args(const char *name,
 
        DEBUGP("Parsing ARGS: %s\n", args);
 
+       /* Chew leading spaces */
+       while (*args == ' ')
+               args++;
+
        while (*args) {
                int ret;