1 |
--- mkinitrd-4.2.1.8/nash/nash.c.orig |
2 |
+++ mkinitrd-4.2.1.8/nash/nash.c |
3 |
@@ -836,11 +836,18 @@ |
4 |
} |
5 |
|
6 |
if (cmdline != NULL) { |
7 |
+ char quote = '\0'; |
8 |
char * chptr, * start; |
9 |
|
10 |
start = chptr = cmdline; |
11 |
for (; (i < MAX_INIT_ARGS) && (*start != '\0'); i++) { |
12 |
- while (*chptr && !isspace(*chptr)) chptr++; |
13 |
+ while (*chptr && (*chptr != quote)) { |
14 |
+ if (isspace(*chptr) && quote == '\0') break; |
15 |
+ if (*chptr == '"') quote = '"'; |
16 |
+ if (*chptr == '\'') quote = '\''; |
17 |
+ chptr++; |
18 |
+ } |
19 |
+ if (quote == '"' || quote == '\'') chptr++; |
20 |
if (*chptr != '\0') *(chptr++) = '\0'; |
21 |
initargs[i] = strdup(start); |
22 |
start = chptr; |