diff options
Diffstat (limited to 'ShellPkg/Library/UefiShellLevel1CommandsLib/If.c')
-rw-r--r-- | ShellPkg/Library/UefiShellLevel1CommandsLib/If.c | 118 |
1 files changed, 59 insertions, 59 deletions
diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c index 35c5ca6..1438060 100644 --- a/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c +++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c @@ -2,7 +2,7 @@ Main file for If and else shell level 1 function.
(C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>
- Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -335,7 +335,7 @@ TestOperation ( /**
Process an if statement and determine if its is valid or not.
- @param[in, out] PassingState Opon entry, the current state. Upon exit,
+ @param[in, out] PassingState Opon entry, the current state. Upon exit,
the new state.
@param[in] StartParameterNumber The number of the first parameter of
this statement.
@@ -346,7 +346,7 @@ TestOperation ( @param[in] ForceStringCompare TRUE for all string based, FALSE otherwise.
@retval EFI_INVALID_PARAMETER A parameter was invalid.
- @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_SUCCESS The operation was successful.
**/
EFI_STATUS
ProcessStatement (
@@ -649,9 +649,9 @@ ProcessStatement ( Break up the next part of the if statement (until the next 'and', 'or', or 'then').
@param[in] ParameterNumber The current parameter number.
- @param[out] EndParameter Upon successful return, will point to the
+ @param[out] EndParameter Upon successful return, will point to the
parameter to start the next iteration with.
- @param[out] EndTag Upon successful return, will point to the
+ @param[out] EndTag Upon successful return, will point to the
type that was found at the end of this statement.
@retval TRUE A valid statement was found.
@@ -837,12 +837,12 @@ ShellCommandRunIf ( ASSERT_EFI_ERROR(Status);
if (!gEfiShellProtocol->BatchIsActive()) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel1HiiHandle, L"if");
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel1HiiHandle, L"if");
return (SHELL_UNSUPPORTED);
}
if (gEfiShellParametersProtocol->Argc < 3) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle, L"if");
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle, L"if");
return (SHELL_INVALID_PARAMETER);
}
@@ -852,14 +852,14 @@ ShellCommandRunIf ( CurrentScriptFile = ShellCommandGetCurrentScriptFile();
if (!MoveToTag(GetNextNode, L"endif", L"if", NULL, CurrentScriptFile, TRUE, TRUE, FALSE)) {
ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
- gShellLevel1HiiHandle,
- L"EndIf",
- L"If",
- CurrentScriptFile!=NULL
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
+ gShellLevel1HiiHandle,
+ L"EndIf",
+ L"If",
+ CurrentScriptFile!=NULL
&& CurrentScriptFile->CurrentCommand!=NULL
? CurrentScriptFile->CurrentCommand->Line:0);
return (SHELL_DEVICE_ERROR);
@@ -920,12 +920,12 @@ ShellCommandRunIf ( // we are at the then
//
if (CurrentParameter+1 != gEfiShellParametersProtocol->Argc) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_TEXT_AFTER_THEN), gShellLevel1HiiHandle, L"if");
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_TEXT_AFTER_THEN), gShellLevel1HiiHandle, L"if");
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
Status = PerformResultOperation(CurrentValue);
if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_AFTER_BAD), gShellLevel1HiiHandle, L"if", gEfiShellParametersProtocol->Argv[CurrentParameter]);
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_AFTER_BAD), gShellLevel1HiiHandle, L"if", gEfiShellParametersProtocol->Argv[CurrentParameter]);
ShellStatus = SHELL_INVALID_PARAMETER;
}
}
@@ -937,14 +937,14 @@ ShellCommandRunIf ( if (!BuildNextStatement(CurrentParameter, &EndParameter, &Ending)) {
CurrentScriptFile = ShellCommandGetCurrentScriptFile();
ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
- gShellLevel1HiiHandle,
- L"Then",
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
+ gShellLevel1HiiHandle,
+ L"Then",
L"If",
- CurrentScriptFile!=NULL
+ CurrentScriptFile!=NULL
&& CurrentScriptFile->CurrentCommand!=NULL
? CurrentScriptFile->CurrentCommand->Line:0);
ShellStatus = SHELL_INVALID_PARAMETER;
@@ -963,7 +963,7 @@ ShellCommandRunIf ( if ((Ending == EndTagOr && CurrentValue) || (Ending == EndTagAnd && !CurrentValue)) {
Status = PerformResultOperation(CurrentValue);
if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_AFTER_BAD), gShellLevel1HiiHandle, L"if", gEfiShellParametersProtocol->Argv[CurrentParameter]);
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_AFTER_BAD), gShellLevel1HiiHandle, L"if", gEfiShellParametersProtocol->Argv[CurrentParameter]);
ShellStatus = SHELL_INVALID_PARAMETER;
}
break;
@@ -1004,7 +1004,7 @@ ShellCommandRunElse ( ASSERT_EFI_ERROR (Status);
if (gEfiShellParametersProtocol->Argc > 1) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle, L"if");
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle, L"if");
return (SHELL_INVALID_PARAMETER);
}
@@ -1017,28 +1017,28 @@ ShellCommandRunElse ( if (!MoveToTag(GetPreviousNode, L"if", L"endif", NULL, CurrentScriptFile, FALSE, TRUE, FALSE)) {
ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
- gShellLevel1HiiHandle,
- L"If",
- L"Else",
- CurrentScriptFile!=NULL
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
+ gShellLevel1HiiHandle,
+ L"If",
+ L"Else",
+ CurrentScriptFile!=NULL
&& CurrentScriptFile->CurrentCommand!=NULL
? CurrentScriptFile->CurrentCommand->Line:0);
return (SHELL_DEVICE_ERROR);
}
if (!MoveToTag(GetPreviousNode, L"if", L"else", NULL, CurrentScriptFile, FALSE, TRUE, FALSE)) {
ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
- gShellLevel1HiiHandle,
- L"If",
- L"Else",
- CurrentScriptFile!=NULL
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
+ gShellLevel1HiiHandle,
+ L"If",
+ L"Else",
+ CurrentScriptFile!=NULL
&& CurrentScriptFile->CurrentCommand!=NULL
? CurrentScriptFile->CurrentCommand->Line:0);
return (SHELL_DEVICE_ERROR);
@@ -1046,14 +1046,14 @@ ShellCommandRunElse ( if (!MoveToTag(GetNextNode, L"endif", L"if", NULL, CurrentScriptFile, FALSE, FALSE, FALSE)) {
ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
- gShellLevel1HiiHandle,
- L"EndIf",
- "Else",
- CurrentScriptFile!=NULL
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
+ gShellLevel1HiiHandle,
+ L"EndIf",
+ "Else",
+ CurrentScriptFile!=NULL
&& CurrentScriptFile->CurrentCommand!=NULL
? CurrentScriptFile->CurrentCommand->Line:0);
return (SHELL_DEVICE_ERROR);
@@ -1082,7 +1082,7 @@ ShellCommandRunEndIf ( ASSERT_EFI_ERROR (Status);
if (gEfiShellParametersProtocol->Argc > 1) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle, L"if");
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle, L"if");
return (SHELL_INVALID_PARAMETER);
}
@@ -1094,14 +1094,14 @@ ShellCommandRunEndIf ( CurrentScriptFile = ShellCommandGetCurrentScriptFile();
if (!MoveToTag(GetPreviousNode, L"if", L"endif", NULL, CurrentScriptFile, FALSE, TRUE, FALSE)) {
ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
- gShellLevel1HiiHandle,
- L"If",
- L"EndIf",
- CurrentScriptFile!=NULL
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
+ gShellLevel1HiiHandle,
+ L"If",
+ L"EndIf",
+ CurrentScriptFile!=NULL
&& CurrentScriptFile->CurrentCommand!=NULL
? CurrentScriptFile->CurrentCommand->Line:0);
return (SHELL_DEVICE_ERROR);
|