From fbd2dfadfe6fb16ab7b49fca3764e05e65d97b8a Mon Sep 17 00:00:00 2001 From: Qiu Shumin Date: Fri, 23 Oct 2015 02:03:20 +0000 Subject: ShellPkg: Follow spec to remove the last '\' char in return name of GetCurDir(). In Shell spec 2.1 the return name of EFI_SHELL_PROTOCOL.GetCurDir() is defined as 'fs0:\current-dir' while in current implementation it's 'fs0:\current-dir\'. To follow spec the patch removed the redundant '\' char. Since it has been broken for a long time, some codes may depend on the broken behavior. After this change 'EFI_SHELL_PROTOCOL.GetCurDir()' and 'UefiShellLib.ShellGetCurrentDir()' will return a current directory string without tailing '\' (fs0:\current-dir), the value of Shell environment variable 'cwd' will become 'fs0:\current-dir' as well. This patch has updated all the code in EDKII to make them depend on the new behavior. Developers should check whether 'GetCurDir()' and 'ShellGetCurrentDir' are used in their source code. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin Reviewed-by: Jaben Carsey git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18653 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c') diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c index 4ac7e67007..0dafb19969 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c @@ -22,7 +22,7 @@ * functions are non-interactive only Copyright (c) 2014 Hewlett-Packard Development Company, L.P. - Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2015, 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 which accompanies this distribution. The full text of the license may be found at @@ -188,6 +188,7 @@ GetFullyQualifiedPath( if (StrStr(Path, L":") == NULL) { CurDir = gEfiShellProtocol->GetCurDir(NULL); StrnCatGrow(&PathToReturn, &Size, CurDir, 0); + StrnCatGrow(&PathToReturn, &Size, L"\\", 0); if (*Path == L'\\') { Path++; } -- cgit v1.2.3