ShellPkg: Check for Abort flag in main 'for' loop of ls command and propagate the condition when found.
Also prevents printing of an error output when user selects abort. signed-off-by: jcarsey reviewed-by: git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12925 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Main file for ls shell level 2 function.
|
Main file for ls shell level 2 function.
|
||||||
|
|
||||||
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -354,9 +354,14 @@ PrintLsOutput(
|
|||||||
ShellStatus = SHELL_OUT_OF_RESOURCES;
|
ShellStatus = SHELL_OUT_OF_RESOURCES;
|
||||||
} else {
|
} else {
|
||||||
for ( Node = (EFI_SHELL_FILE_INFO *)GetFirstNode(&ListHead->Link)
|
for ( Node = (EFI_SHELL_FILE_INFO *)GetFirstNode(&ListHead->Link)
|
||||||
; !IsNull(&ListHead->Link, &Node->Link)
|
; !IsNull(&ListHead->Link, &Node->Link) && ShellStatus == SHELL_SUCCESS
|
||||||
; Node = (EFI_SHELL_FILE_INFO *)GetNextNode(&ListHead->Link, &Node->Link)
|
; Node = (EFI_SHELL_FILE_INFO *)GetNextNode(&ListHead->Link, &Node->Link)
|
||||||
){
|
){
|
||||||
|
if (ShellGetExecutionBreakFlag ()) {
|
||||||
|
ShellStatus = SHELL_ABORTED;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// recurse on any directory except the traversing ones...
|
// recurse on any directory except the traversing ones...
|
||||||
//
|
//
|
||||||
@ -366,7 +371,7 @@ PrintLsOutput(
|
|||||||
){
|
){
|
||||||
StrCpy(DirectoryName, Node->FullName);
|
StrCpy(DirectoryName, Node->FullName);
|
||||||
StrCat(DirectoryName, L"\\*");
|
StrCat(DirectoryName, L"\\*");
|
||||||
PrintLsOutput(
|
ShellStatus = PrintLsOutput(
|
||||||
Rec,
|
Rec,
|
||||||
Attribs,
|
Attribs,
|
||||||
Sfo,
|
Sfo,
|
||||||
@ -558,6 +563,10 @@ ShellCommandRunLs (
|
|||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_FILES), gShellLevel2HiiHandle);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_FILES), gShellLevel2HiiHandle);
|
||||||
} else if (ShellStatus == SHELL_INVALID_PARAMETER) {
|
} else if (ShellStatus == SHELL_INVALID_PARAMETER) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel2HiiHandle);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel2HiiHandle);
|
||||||
|
} else if (ShellStatus == SHELL_ABORTED) {
|
||||||
|
//
|
||||||
|
// Ignore aborting.
|
||||||
|
//
|
||||||
} else if (ShellStatus != SHELL_SUCCESS) {
|
} else if (ShellStatus != SHELL_SUCCESS) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel2HiiHandle);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel2HiiHandle);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user