clarify error message when listing files based on a metaname without a current working directory.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11450 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jcarsey 2011-03-29 20:19:51 +00:00
parent 0841f3af8c
commit 2ec013ce0f
1 changed files with 9 additions and 4 deletions

View File

@ -523,11 +523,16 @@ ShellCommandRunLs (
} }
} }
if (PathName != NULL) { if (PathName != NULL) {
if (StrStr(PathName, L":") == NULL && gEfiShellProtocol->GetCurDir(NULL) == NULL) {
ShellStatus = SHELL_NOT_FOUND;
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellLevel2HiiHandle);
} else {
ASSERT((FullPath == NULL && Size == 0) || (FullPath != NULL)); ASSERT((FullPath == NULL && Size == 0) || (FullPath != NULL));
StrnCatGrow(&FullPath, &Size, PathName, 0); StrnCatGrow(&FullPath, &Size, PathName, 0);
if (ShellIsDirectory(PathName) == EFI_SUCCESS) { if (ShellIsDirectory(PathName) == EFI_SUCCESS) {
StrnCatGrow(&FullPath, &Size, L"\\*", 0); StrnCatGrow(&FullPath, &Size, L"\\*", 0);
} }
}
} else { } else {
ASSERT(FullPath == NULL); ASSERT(FullPath == NULL);
StrnCatGrow(&FullPath, NULL, L"*", 0); StrnCatGrow(&FullPath, NULL, L"*", 0);