X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ShellPkg%2FLibrary%2FUefiShellLevel2CommandsLib%2FLs.c;fp=ShellPkg%2FLibrary%2FUefiShellLevel2CommandsLib%2FLs.c;h=523096ac22d9e9cca2ec196e21aa4d7229d421e3;hp=64ce4ae2c02b9e6a3130bfc8ad7681bb4e3d055a;hb=8a3146d46cea07829a0948f0848db04784541cea;hpb=9b5268c8f7223422de1ad5b278355586f088cdde diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c index 64ce4ae2c0..523096ac22 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c @@ -1,7 +1,7 @@ /** @file Main file for ls shell level 2 function. - Copyright (c) 2013 Hewlett-Packard Development Company, L.P. + Copyright (c) 2013 - 2014, Hewlett-Packard Development Company, L.P.
Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -408,6 +408,10 @@ PrintLsOutput( ; !IsNull(&ListHead->Link, &Node->Link) ; Node = (EFI_SHELL_FILE_INFO *)GetNextNode(&ListHead->Link, &Node->Link) ){ + if (ShellGetExecutionBreakFlag ()) { + ShellStatus = SHELL_ABORTED; + break; + } ASSERT(Node != NULL); if (LongestPath < StrSize(Node->FullName)) { LongestPath = StrSize(Node->FullName); @@ -445,12 +449,12 @@ PrintLsOutput( HeaderPrinted = TRUE; } - if (!Sfo) { + if (!Sfo && ShellStatus != SHELL_ABORTED) { PrintNonSfoFooter(FileCount, FileSize, DirCount); } } - if (Rec) { + if (Rec && ShellStatus != SHELL_ABORTED) { // // Re-Open all the files under the starting path for directories that didnt necessarily match our file filter // @@ -493,6 +497,13 @@ PrintLsOutput( &FoundOne, Count, TimeZone); + + // + // Since it's running recursively, we have to break immediately when returned SHELL_ABORTED + // + if (ShellStatus == SHELL_ABORTED) { + break; + } } } }