mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 14:53:40 +00:00
[CMD] FOR: Some functionality is available only when extensions are enabled.
This is basically all the advanced functionality enabled with the /D, /R, /L and /F flags, and the usage of enhanced variables.
This commit is contained in:
parent
fedc68aea8
commit
41a93a4e58
2 changed files with 26 additions and 12 deletions
|
@ -500,6 +500,9 @@ ExecuteFor(PARSED_COMMAND *Cmd)
|
||||||
Cmd->For.Context = lpNew;
|
Cmd->For.Context = lpNew;
|
||||||
fc = lpNew;
|
fc = lpNew;
|
||||||
|
|
||||||
|
/* Run the extended FOR syntax only if extensions are enabled */
|
||||||
|
if (bEnableExtensions)
|
||||||
|
{
|
||||||
if (Cmd->For.Switches & FOR_F)
|
if (Cmd->For.Switches & FOR_F)
|
||||||
{
|
{
|
||||||
Ret = ForF(Cmd, List, Buffer);
|
Ret = ForF(Cmd, List, Buffer);
|
||||||
|
@ -518,6 +521,11 @@ ExecuteFor(PARSED_COMMAND *Cmd)
|
||||||
{
|
{
|
||||||
Ret = ForDir(Cmd, List, Buffer, Buffer);
|
Ret = ForDir(Cmd, List, Buffer, Buffer);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Ret = ForDir(Cmd, List, Buffer, Buffer);
|
||||||
|
}
|
||||||
|
|
||||||
/* Remove our context, unless someone already did that */
|
/* Remove our context, unless someone already did that */
|
||||||
if (fc == lpNew)
|
if (fc == lpNew)
|
||||||
|
|
|
@ -494,6 +494,10 @@ static PARSED_COMMAND *ParseFor(void)
|
||||||
memset(Cmd, 0, sizeof(PARSED_COMMAND));
|
memset(Cmd, 0, sizeof(PARSED_COMMAND));
|
||||||
Cmd->Type = C_FOR;
|
Cmd->Type = C_FOR;
|
||||||
|
|
||||||
|
/* Skip the extended FOR syntax if extensions are disabled */
|
||||||
|
if (!bEnableExtensions)
|
||||||
|
goto parseForBody;
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
if (_tcsicmp(CurrentToken, _T("/D")) == 0)
|
if (_tcsicmp(CurrentToken, _T("/D")) == 0)
|
||||||
|
@ -543,6 +547,8 @@ static PARSED_COMMAND *ParseFor(void)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parseForBody:
|
||||||
|
|
||||||
/* Variable name should be % and just one other character */
|
/* Variable name should be % and just one other character */
|
||||||
if (CurrentToken[0] != _T('%') || _tcslen(CurrentToken) != 2)
|
if (CurrentToken[0] != _T('%') || _tcslen(CurrentToken) != 2)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue