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 <shumin.qiu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Qiu Shumin 2016-06-21 16:18:56 +08:00
parent 61257251b2
commit 85df61243c
1 changed files with 4 additions and 2 deletions

View File

@ -1,7 +1,7 @@
/** @file /** @file
Defines file-path manipulation functions. Defines file-path manipulation functions.
Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR> Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 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) { if ((TempString = StrStr(Path, L"\\..")) != NULL && *(TempString + 3) == CHAR_NULL) {
*TempString = CHAR_NULL; *TempString = CHAR_NULL;
PathRemoveLastItem(Path); if (!PathRemoveLastItem(Path)) {
*TempString = L'\\';
}
} }
// //
// Fix up the . // Fix up the .