+ char *inp, *outp;
+ char c, quote;
+
+ debug_parser("%s: \"%s\"\n", __func__, line);
+
+ for (outp = inp = line, quote = '\0' ;
+ nargs < CONFIG_SYS_MAXARGS && (c = *inp) != '\0';
+ inp++) {
+
+ switch (state) {
+ case 0:
+ if (isblank(c))
+ continue;
+
+ argv[nargs++] = inp; /* begin of argument string */
+ outp = inp;
+ state = 1;
+ /* fall thru */
+
+ case 1:
+ if (c == '\\') {
+ ++state;
+ continue;
+ }
+ if (c == '\"' || c == '\'') {
+ quote = c;
+ state = 3;
+ continue;
+ }
+ if (isblank(c)) {
+ c = '\0';
+ state = 0;
+ }
+ break;
+
+ case 3:
+ if (c == '\\' && quote == '\"') {
+ ++state;
+ continue;
+ }
+ if (c == quote) {
+ state = 1;
+ continue;
+ }
+ break;