+ /* Skips white spaces */
+ while (strchr ("\t ", *line))
+ line++;
+ if (!*line)
+ break;
+
+ /* Starts a new parameter */
+ argv = realloc (argv, (argc + 2) * sizeof (char *));
+ if (*line == '"')
+ {
+ quote = '"';
+ line++;
+ }
+ argv[argc++] = line;
+
+ more:
+ while (*line && !strchr ("\t ", *line))
+ line++;
+
+ if (line > argv[argc - 1] && line[-1] == quote)
+ /* End of quoted parameter */
+ line[-1] = 0;
+ else
+ if (*line && quote)
+ {
+ /* Space within a quote */
+ line++;
+ goto more;
+ }
+ else
+ /* End of unquoted parameter */
+ if (*line)
+ *line++ = 0;
+ }
+ argv[argc] = NULL;
+ *argvp = argv;
+ return argc;
+}
+#endif