mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
[NETSH] Improve MatchTagsInCmdLine
- Remove the tag name after the a tagged argument has been identified.
This commit is contained in:
@@ -359,6 +359,7 @@ MatchEnumTag(
|
||||
|
||||
for (i = 0; i < dwNumArg; i++)
|
||||
{
|
||||
DPRINT("%S -- %S\n", pwcArg, pEnumTable[i].pwszToken);
|
||||
if (MatchToken(pwcArg, pEnumTable[i].pwszToken))
|
||||
{
|
||||
*pdwValue = pEnumTable[i].dwValue;
|
||||
@@ -390,6 +391,7 @@ MatchTagsInCmdLine(
|
||||
for (i = dwCurrentIndex; i < dwArgCount; i++)
|
||||
{
|
||||
DPRINT("Argument %lu: %S\n", i, ppwcArguments[i]);
|
||||
pdwTagType[i - dwCurrentIndex] = (DWORD)-1;
|
||||
|
||||
/* Skip arguments that do not have a tag */
|
||||
pszEqual = wcschr(ppwcArguments[i], L'=');
|
||||
@@ -403,13 +405,16 @@ MatchTagsInCmdLine(
|
||||
pdwTagType[i - dwCurrentIndex] = (DWORD)-1;
|
||||
for (j = 0; j < dwTagCount; j++)
|
||||
{
|
||||
DPRINT("Test tag %S\n", pttTags[j].pwszTag);
|
||||
DPRINT("Test tag %S -- %S\n", pttTags[j].pwszTag, ppwcArguments[i]);
|
||||
if ((wcslen(pttTags[j].pwszTag) == dwTagLength) &&
|
||||
(_wcsnicmp(ppwcArguments[i], pttTags[j].pwszTag, dwTagLength) == 0))
|
||||
{
|
||||
DPRINT("Found tag %S\n", pttTags[j].pwszTag);
|
||||
pttTags[j].bPresent = TRUE;
|
||||
pdwTagType[i - dwCurrentIndex] = j;
|
||||
|
||||
/* Remove the tag name from the argument */
|
||||
wcscpy(ppwcArguments[i], pszEqual + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user