ShellPkg: fix support for "\" (or "\.") meaning root of drive.

Cp command fixed to allow for copying single or multiple files to the root of the drive with destination directory \.
Cd command fixed to allow for changing CWD to the root of the drive with destination directory \.

signed-off-by: jcarsey
reviewed-by: geekboy15a

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12392 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jcarsey
2011-09-20 21:01:34 +00:00
parent e291948ce0
commit 1fc3749dad
3 changed files with 28 additions and 12 deletions

View File

@ -359,7 +359,19 @@ ValidateAndCopyFiles(
//
// we have multiple files or a directory in the DestDir
//
if (StrStr(DestDir, L":") == NULL) {
//
// Check for leading slash
//
if (DestDir[0] == L'\\') {
//
// Copy to the root of CWD
//
StrCpy(DestPath, Cwd);
while (PathRemoveLastItem(DestPath));
StrCat(DestPath, DestDir+1);
StrCat(DestPath, Node->FileName);
} else if (StrStr(DestDir, L":") == NULL) {
StrCpy(DestPath, Cwd);
if (DestPath[StrLen(DestPath)-1] != L'\\' && DestDir[0] != L'\\') {
StrCat(DestPath, L"\\");