[NETSH] Do not split arguments at whitespace between quotation marks

This commit is contained in:
Eric Kohl
2026-05-13 23:35:09 +02:00
parent 9761df14f0
commit 858b8fd42c

View File

@@ -389,6 +389,7 @@ InterpretInteractive(VOID)
DWORD dwArgCount = 0;
BOOL bWhiteSpace = TRUE;
BOOL bDone = FALSE;
BOOL bInQuotes = FALSE;
LPWSTR ptr;
DWORD dwError = ERROR_SUCCESS;
@@ -409,7 +410,10 @@ InterpretInteractive(VOID)
ptr = input_line;
while (*ptr != 0)
{
if (iswspace(*ptr) || *ptr == L'\n')
if (*ptr == L'\"')
bInQuotes = (bInQuotes) ? FALSE : TRUE;
if ((iswspace(*ptr) && (bInQuotes == FALSE)) || *ptr == L'\n')
{
*ptr = 0;
bWhiteSpace = TRUE;