]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg: Fix 'cd ..\..' go up only 1 level.
authorQiu Shumin <shumin.qiu@intel.com>
Tue, 21 Jun 2016 08:18:56 +0000 (16:18 +0800)
committerQiu Shumin <shumin.qiu@intel.com>
Wed, 22 Jun 2016 05:08:44 +0000 (13:08 +0800)
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>
MdePkg/Library/BaseLib/FilePaths.c

index b7ff480bb96295f35fd90aa55264031c68361319..c72ef726ba46aeada674b235dcfd4c765aaf81b2 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Defines file-path manipulation functions.\r
 \r
-  Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -96,7 +96,9 @@ PathCleanUpDirectories(
   }\r
   if ((TempString = StrStr(Path, L"\\..")) != NULL && *(TempString + 3) == CHAR_NULL) {\r
     *TempString = CHAR_NULL;\r
-    PathRemoveLastItem(Path);\r
+    if (!PathRemoveLastItem(Path)) {\r
+      *TempString = L'\\';\r
+    }\r
   }\r
   //\r
   // Fix up the .\r