X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ShellPkg%2FLibrary%2FUefiShellLevel1CommandsLib%2FGoto.c;h=4d48c7f1e9436ac351678ea345276f10b4558276;hp=3e5a59c5756019d325cbca3d4c8f3a27f00960b3;hb=ae724571beb0cff6edefe42942b7cdc7aa81ee94;hpb=33c031ee2092282a069ce07d30202082ceaf61fe diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/Goto.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/Goto.c index 3e5a59c575..4d48c7f1e9 100644 --- a/ShellPkg/Library/UefiShellLevel1CommandsLib/Goto.c +++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/Goto.c @@ -33,6 +33,7 @@ ShellCommandRunGoto ( SHELL_STATUS ShellStatus; CHAR16 *CompareString; UINTN Size; + SCRIPT_FILE *CurrentScriptFile; ShellStatus = SHELL_SUCCESS; CompareString = NULL; @@ -79,6 +80,7 @@ ShellCommandRunGoto ( // Check forwards and then backwards for a label... // if (!MoveToTag(GetNextNode, L"endfor", L"for", CompareString, ShellCommandGetCurrentScriptFile(), FALSE, FALSE, TRUE)) { + CurrentScriptFile = ShellCommandGetCurrentScriptFile(); ShellPrintHiiEx( -1, -1, @@ -87,9 +89,9 @@ ShellCommandRunGoto ( gShellLevel1HiiHandle, CompareString, L"Goto", - ShellCommandGetCurrentScriptFile()!=NULL - &&ShellCommandGetCurrentScriptFile()->CurrentCommand!=NULL - ?ShellCommandGetCurrentScriptFile()->CurrentCommand->Line:0); + CurrentScriptFile!=NULL + && CurrentScriptFile->CurrentCommand!=NULL + ? CurrentScriptFile->CurrentCommand->Line:0); ShellStatus = SHELL_NOT_FOUND; } FreePool(CompareString);