From c32ad351618b43f9307823d9acb748bc42c58333 Mon Sep 17 00:00:00 2001 From: Chris Phillips Date: Fri, 18 Oct 2013 20:10:18 +0000 Subject: =?UTF-8?q?ShellPkg:=20Fix=20for=20the=20=E2=80=98mv=E2=80=99=20co?= =?UTF-8?q?mmand=20when=20destination=20starts=20with=20=E2=80=98\?= =?UTF-8?q?=E2=80=99.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chris Phillips reviewed-by: Jaben Carsey git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14787 6f19259b-4bc3-4df7-8a09-765794883524 --- ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'ShellPkg/Library/UefiShellLevel2CommandsLib') diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c index 0d01ad7487..65e83ccc0f 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c @@ -1,6 +1,7 @@ /** @file Main file for mv shell level 2 function. + Copyright (c) 2013, Hewlett-Packard Development Company, L.P. Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -137,6 +138,7 @@ GetDestinationLocation( EFI_SHELL_FILE_INFO *Node; CHAR16 *DestPath; UINTN NewSize; + UINTN CurrentSize; DestList = NULL; DestPath = NULL; @@ -151,6 +153,13 @@ GetDestinationLocation( } StrCpy(DestPath, Cwd); while (PathRemoveLastItem(DestPath)) ; + + // + // Append DestDir beyond '\' which may be present + // + CurrentSize = StrSize(DestPath); + StrnCatGrow(&DestPath, &CurrentSize, &DestDir[1], 0); + *DestPathPointer = DestPath; return (SHELL_SUCCESS); } -- cgit v1.2.3