diff options
author | Qiu Shumin <shumin.qiu@intel.com> | 2016-06-21 16:18:56 +0800 |
---|---|---|
committer | Qiu Shumin <shumin.qiu@intel.com> | 2016-06-22 13:08:44 +0800 |
commit | 85df61243cb56c3d9c52a5005e65c4ea8bf60e52 (patch) | |
tree | f5a982aed5502591e6251e5acd642c9353542cef | |
parent | 61257251b2f48ceac54fea42665e1f2e63dbb46e (diff) | |
download | edk2-platforms-85df61243cb56c3d9c52a5005e65c4ea8bf60e52.tar.xz |
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>
-rw-r--r-- | MdePkg/Library/BaseLib/FilePaths.c | 6 |
1 files changed, 4 insertions, 2 deletions
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.<BR>
+ Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>
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 .
|