If a module parameter on the command line contains quotes, any
spaces inside those quotes should be included as part of the
parameter.
Signed-off-by: James Minor <james.minor@ni.com>
char buf[KCMD_LINE_SIZE];
int fd, err;
char *p, *modname, *param = NULL, *value = NULL, is_module = 1;
+ bool is_quoted = false;
fd = open("/proc/cmdline", O_RDONLY|O_CLOEXEC);
if (fd < 0) {
}
for (p = buf, modname = buf; *p != '\0' && *p != '\n'; p++) {
+ if (*p == '"') {
+ is_quoted = !is_quoted;
+ continue;
+ }
+ if (is_quoted)
+ continue;
switch (*p) {
case ' ':
*p = '\0';