ShellPkg: Fix using root of drive

This allows near complete use of drive roots “fs0:” and “fs0:\” as directories and arguments to commands.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jaben Carsey <Jaben.carsey@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
Reviewed-by: Tapan Shah <tapandshah@hp.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15463 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Jaben Carsey 2014-04-11 19:15:02 +00:00 committed by jcarsey
parent 5f119dfc90
commit bbf904d154
2 changed files with 12 additions and 2 deletions

View File

@ -1914,6 +1914,8 @@ CreateAndPopulateShellFileInfo(
} }
} }
TempString = PathCleanUpDirectories(TempString);
ShellFileListItem->FullName = TempString; ShellFileListItem->FullName = TempString;
ShellFileListItem->Status = Status; ShellFileListItem->Status = Status;
ShellFileListItem->Handle = Handle; ShellFileListItem->Handle = Handle;
@ -2143,7 +2145,7 @@ ShellSearchHandle(
// //
FileInfo = FileHandleGetInfo(FileHandle); FileInfo = FileHandleGetInfo(FileHandle);
NewShellNode = CreateAndPopulateShellFileInfo( NewShellNode = CreateAndPopulateShellFileInfo(
L":", MapName,
EFI_SUCCESS, EFI_SUCCESS,
L"\\", L"\\",
FileHandle, FileHandle,

View File

@ -116,7 +116,15 @@ PathCleanUpDirectories(
*(TempString + 1) = CHAR_NULL; *(TempString + 1) = CHAR_NULL;
} }
while ((TempString = StrStr(Path, L"\\\\")) != NULL) {
*TempString = CHAR_NULL;
TempString += 1;
TempSize = StrSize(TempString);
CopyMem(Path+StrLen(Path), TempString, TempSize);
}
if ((TempString = StrStr(Path, L"\\\\")) != NULL && *(TempString + 1) == CHAR_NULL) {
*(TempString) = CHAR_NULL;
}
return (Path); return (Path);
} }