mirror of
https://github.com/reactos/reactos.git
synced 2025-04-22 13:10:39 +00:00
Make IF /? work again
svn path=/trunk/; revision=38481
This commit is contained in:
parent
85084975fe
commit
00fd22c6ba
3 changed files with 23 additions and 14 deletions
|
@ -120,7 +120,7 @@ COMMAND cmds[] =
|
|||
{_T("history"), 0, CommandHistory},
|
||||
#endif
|
||||
|
||||
// {_T("if"), 0, cmd_if},
|
||||
{_T("if"), 0, cmd_if},
|
||||
|
||||
#ifdef INCLUDE_CMD_LABEL
|
||||
{_T("label"), 0, cmd_label},
|
||||
|
|
|
@ -49,13 +49,8 @@ static INT GenericCmp(INT (*StringCmp)(LPCTSTR, LPCTSTR),
|
|||
return StringCmp(Left, Right);
|
||||
}
|
||||
|
||||
BOOL ExecuteIf(PARSED_COMMAND *Cmd)
|
||||
INT cmd_if (LPTSTR param)
|
||||
{
|
||||
INT result = FALSE; /* when set cause 'then' clause to be executed */
|
||||
LPTSTR param;
|
||||
|
||||
#if 0
|
||||
/* FIXME: need to handle IF /?; will require special parsing */
|
||||
TRACE ("cmd_if: (\'%s\')\n", debugstr_aw(param));
|
||||
|
||||
if (!_tcsncmp (param, _T("/?"), 2))
|
||||
|
@ -63,7 +58,15 @@ BOOL ExecuteIf(PARSED_COMMAND *Cmd)
|
|||
ConOutResPaging(TRUE,STRING_IF_HELP1);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
error_syntax(param);
|
||||
return 1;
|
||||
}
|
||||
|
||||
BOOL ExecuteIf(PARSED_COMMAND *Cmd)
|
||||
{
|
||||
INT result = FALSE; /* when set cause 'then' clause to be executed */
|
||||
LPTSTR param;
|
||||
|
||||
if (Cmd->If.Operator == IF_CMDEXTVERSION)
|
||||
{
|
||||
|
|
|
@ -332,7 +332,7 @@ static PARSED_COMMAND *ParseIf(void)
|
|||
memset(Cmd, 0, sizeof(PARSED_COMMAND));
|
||||
Cmd->Type = C_IF;
|
||||
|
||||
int Type = ParseToken(0, STANDARD_SEPS);
|
||||
int Type = CurrentTokenType;
|
||||
if (_tcsicmp(CurrentToken, _T("/I")) == 0)
|
||||
{
|
||||
Cmd->If.Flags |= IFFLAG_IGNORECASE;
|
||||
|
@ -487,6 +487,10 @@ static PARSED_COMMAND *ParseCommandPart(void)
|
|||
|
||||
/* Check for special forms */
|
||||
if (_tcsicmp(ParsedLine, _T("if")) == 0)
|
||||
{
|
||||
ParseToken(0, STANDARD_SEPS);
|
||||
/* Do special parsing only if it's not followed by /? */
|
||||
if (_tcscmp(CurrentToken, _T("/?")) != 0)
|
||||
{
|
||||
if (RedirList)
|
||||
{
|
||||
|
@ -496,6 +500,8 @@ static PARSED_COMMAND *ParseCommandPart(void)
|
|||
}
|
||||
return ParseIf();
|
||||
}
|
||||
Pos = _stpcpy(Pos, _T(" /?"));
|
||||
}
|
||||
|
||||
/* Now get the tail */
|
||||
while (1)
|
||||
|
|
Loading…
Reference in a new issue