Fix for command line with multiple spaces between args. (#981)

This commit is contained in:
tomcw 2021-09-10 14:51:57 +01:00
parent 35b83765db
commit 1b8d26051e

View File

@ -52,7 +52,7 @@ bool g_bHookAltGrControl = false;
static LPSTR GetCurrArg(LPSTR lpCmdLine)
{
if(*lpCmdLine == '\"')
if (*lpCmdLine == '\"')
lpCmdLine++;
return lpCmdLine;
@ -62,9 +62,9 @@ static LPSTR GetNextArg(LPSTR lpCmdLine)
{
int bInQuotes = 0;
while(*lpCmdLine)
while (*lpCmdLine)
{
if(*lpCmdLine == '\"')
if (*lpCmdLine == '\"')
{
bInQuotes ^= 1;
if(!bInQuotes)
@ -74,9 +74,12 @@ static LPSTR GetNextArg(LPSTR lpCmdLine)
}
}
if((*lpCmdLine == ' ') && !bInQuotes)
if ((*lpCmdLine == ' ') && !bInQuotes)
{
*lpCmdLine++ = 0x00;
while ((*lpCmdLine == ' ')) // Skip multiple spaces between args
lpCmdLine++;
break;
}