while (*lpCmdLine && *lpCmdLine <= ' ')
lpCmdLine++;
- if (*lpCmdLine)
+ if (!*lpCmdLine)
+ break;
+
+ if (*lpCmdLine == '\"')
{
- if (*lpCmdLine == '\"')
- {
- // quoted string
+ // quoted string
+ lpCmdLine++;
+ argv[com_argc] = lpCmdLine;
+ com_argc++;
+ while (*lpCmdLine && (*lpCmdLine != '\"'))
lpCmdLine++;
- argv[com_argc] = lpCmdLine;
- com_argc++;
- while (*lpCmdLine && (*lpCmdLine != '\"'))
- lpCmdLine++;
- }
- else
- {
- // unquoted word
- argv[com_argc] = lpCmdLine;
- com_argc++;
- while (*lpCmdLine && *lpCmdLine > ' ')
- lpCmdLine++;
- }
-
- if (*lpCmdLine)
- {
- *lpCmdLine = 0;
+ }
+ else
+ {
+ // unquoted word
+ argv[com_argc] = lpCmdLine;
+ com_argc++;
+ while (*lpCmdLine && *lpCmdLine > ' ')
lpCmdLine++;
- }
+ }
+
+ if (*lpCmdLine)
+ {
+ *lpCmdLine = 0;
+ lpCmdLine++;
}
}