- if (Rec){\r
- DirectoryName = AllocateZeroPool(LongestPath + 2*sizeof(CHAR16));\r
- if (DirectoryName == NULL) {\r
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_MEM), gShellLevel2HiiHandle);\r
- ShellStatus = SHELL_OUT_OF_RESOURCES;\r
- } else {\r
+ if (Rec && ShellStatus != SHELL_ABORTED) {\r
+ //\r
+ // Re-Open all the files under the starting path for directories that didnt necessarily match our file filter\r
+ //\r
+ ShellCloseFileMetaArg(&ListHead);\r
+ CorrectedPath[0] = CHAR_NULL;\r
+ CorrectedPath = StrnCatGrow(&CorrectedPath, &LongestPath, RootPath, 0);\r
+ if (CorrectedPath == NULL) {\r
+ return SHELL_OUT_OF_RESOURCES;\r
+ }\r
+ if (CorrectedPath[StrLen(CorrectedPath)-1] != L'\\'\r
+ &&CorrectedPath[StrLen(CorrectedPath)-1] != L'/') {\r
+ CorrectedPath = StrnCatGrow(&CorrectedPath, &LongestPath, L"\\", 0);\r
+ }\r
+ CorrectedPath = StrnCatGrow(&CorrectedPath, &LongestPath, L"*", 0);\r
+ Status = ShellOpenFileMetaArg((CHAR16*)CorrectedPath, EFI_FILE_MODE_READ, &ListHead);\r
+ \r
+ if (!EFI_ERROR(Status)) {\r