diff options
author | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-09-20 21:01:34 +0000 |
---|---|---|
committer | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-09-20 21:01:34 +0000 |
commit | 1fc3749dad42e8d5caebf6e0e0327b713b6adaeb (patch) | |
tree | a0d6762cad812852bbd416bdb8603bbdd4087fc3 /ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c | |
parent | e291948ce0b6f3439f83da5861ddd337421dc5e4 (diff) | |
download | edk2-platforms-1fc3749dad42e8d5caebf6e0e0327b713b6adaeb.tar.xz |
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
Diffstat (limited to 'ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c')
-rw-r--r-- | ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c index 08f5514cf5..00b51b4111 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c @@ -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"\\");
|