diff options
author | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-03-29 20:19:51 +0000 |
---|---|---|
committer | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-03-29 20:19:51 +0000 |
commit | 2ec013ce0f9524f140de23810999ed8a62086fc3 (patch) | |
tree | 496d94326804b6496824be55775b173f985b2543 /ShellPkg/Library/UefiShellLevel2CommandsLib | |
parent | 0841f3af8c9a2bd05e81156df1699cc97fdbcd24 (diff) | |
download | edk2-2ec013ce0f9524f140de23810999ed8a62086fc3.zip edk2-2ec013ce0f9524f140de23810999ed8a62086fc3.tar.gz edk2-2ec013ce0f9524f140de23810999ed8a62086fc3.tar.bz2 |
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
Diffstat (limited to 'ShellPkg/Library/UefiShellLevel2CommandsLib')
-rw-r--r-- | ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c index 7376511..64dfae3 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c @@ -523,10 +523,15 @@ ShellCommandRunLs ( }
}
if (PathName != NULL) {
- ASSERT((FullPath == NULL && Size == 0) || (FullPath != NULL));
- StrnCatGrow(&FullPath, &Size, PathName, 0);
- if (ShellIsDirectory(PathName) == EFI_SUCCESS) {
- StrnCatGrow(&FullPath, &Size, L"\\*", 0);
+ 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));
+ StrnCatGrow(&FullPath, &Size, PathName, 0);
+ if (ShellIsDirectory(PathName) == EFI_SUCCESS) {
+ StrnCatGrow(&FullPath, &Size, L"\\*", 0);
+ }
}
} else {
ASSERT(FullPath == NULL);
|