]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: Fix for the ‘mv’ command when destination starts with ‘\’.
authorChris Phillips <chrisp@hp.com>
Fri, 18 Oct 2013 20:10:18 +0000 (20:10 +0000)
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 18 Oct 2013 20:10:18 +0000 (20:10 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chris Phillips <chrisp@hp.com>
reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14787 6f19259b-4bc3-4df7-8a09-765794883524

ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c

index 0d01ad7487be4aea8063c11f0bfe6004c14096e9..65e83ccc0f4336130f150df627acb0fec860a577 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
   Main file for mv shell level 2 function.\r
 \r
+  Copyright (c) 2013, Hewlett-Packard Development Company, L.P.\r
   Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -137,6 +138,7 @@ GetDestinationLocation(
   EFI_SHELL_FILE_INFO       *Node;\r
   CHAR16                    *DestPath;\r
   UINTN                     NewSize;\r
+  UINTN                     CurrentSize;\r
 \r
   DestList = NULL;\r
   DestPath = NULL;\r
@@ -151,6 +153,13 @@ GetDestinationLocation(
     }\r
     StrCpy(DestPath, Cwd);\r
     while (PathRemoveLastItem(DestPath)) ;\r
+\r
+    //\r
+    // Append DestDir beyond '\' which may be present\r
+    //\r
+    CurrentSize = StrSize(DestPath);\r
+    StrnCatGrow(&DestPath, &CurrentSize, &DestDir[1], 0);\r
+\r
     *DestPathPointer =  DestPath;\r
     return (SHELL_SUCCESS);\r
   }\r