From 85df61243cb56c3d9c52a5005e65c4ea8bf60e52 Mon Sep 17 00:00:00 2001 From: Qiu Shumin Date: Tue, 21 Jun 2016 16:18:56 +0800 Subject: MdePkg: Fix 'cd ..\..' go up only 1 level. When we try to cd up two levels using the "../.." notation we only go up one level. This patch fix this bug. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin Reviewed-by: Liming Gao --- MdePkg/Library/BaseLib/FilePaths.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'MdePkg/Library/BaseLib') diff --git a/MdePkg/Library/BaseLib/FilePaths.c b/MdePkg/Library/BaseLib/FilePaths.c index b7ff480bb9..c72ef726ba 100644 --- a/MdePkg/Library/BaseLib/FilePaths.c +++ b/MdePkg/Library/BaseLib/FilePaths.c @@ -1,7 +1,7 @@ /** @file Defines file-path manipulation functions. - Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2011 - 2016, 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 @@ -96,7 +96,9 @@ PathCleanUpDirectories( } if ((TempString = StrStr(Path, L"\\..")) != NULL && *(TempString + 3) == CHAR_NULL) { *TempString = CHAR_NULL; - PathRemoveLastItem(Path); + if (!PathRemoveLastItem(Path)) { + *TempString = L'\\'; + } } // // Fix up the . -- cgit v1.2.3