summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellLib
diff options
context:
space:
mode:
Diffstat (limited to 'ShellPkg/Library/UefiShellLib')
-rw-r--r--ShellPkg/Library/UefiShellLib/UefiShellLib.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
index 6e0f61130f..44ac382980 100644
--- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
+++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
@@ -1276,6 +1276,8 @@ ShellExecute (
name. If the DeviceName is not NULL, it returns the current directory name
on specified drive.
+ Note that the current directory string should exclude the tailing backslash character.
+
@param DeviceName the name of the drive to get directory on
@retval NULL the directory does not exist
@@ -1708,13 +1710,14 @@ ShellFindFilePath (
Path = ShellGetEnvironmentVariable(L"cwd");
if (Path != NULL) {
- Size = StrSize(Path);
+ Size = StrSize(Path) + sizeof(CHAR16);
Size += StrSize(FileName);
TestPath = AllocateZeroPool(Size);
if (TestPath == NULL) {
return (NULL);
}
StrCpyS(TestPath, Size/sizeof(CHAR16), Path);
+ StrCatS(TestPath, Size/sizeof(CHAR16), L"\\");
StrCatS(TestPath, Size/sizeof(CHAR16), FileName);
Status = ShellOpenFileByName(TestPath, &Handle, EFI_FILE_MODE_READ, 0);
if (!EFI_ERROR(Status)){