]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseLib/FilePaths.c
MdePkg-BaseLib: Fix PathCleanUpDirectories() issue with "\\..\\.."
[mirror_edk2.git] / MdePkg / Library / BaseLib / FilePaths.c
index ce6b3720d5d4e513ae4c33c56473b8a81da2b0fc..92e4c350ff261f1e429d2db01f60579529fc1cd3 100644 (file)
@@ -86,6 +86,13 @@ PathCleanUpDirectories(
     }\r
   }\r
 \r
+  //\r
+  // Replace the "\\" with "\"\r
+  //\r
+  while ((TempString = StrStr (Path, L"\\\\")) != NULL) {\r
+    CopyMem (TempString, TempString + 1, StrSize (TempString + 1));\r
+  }\r
+\r
   //\r
   // Remove all the "\.". E.g.: fs0:\abc\.\def\.\r
   //\r
@@ -109,13 +116,6 @@ PathCleanUpDirectories(
     }\r
   }\r
 \r
-  //\r
-  // Replace the "\\" with "\"\r
-  //\r
-  while ((TempString = StrStr (Path, L"\\\\")) != NULL) {\r
-    CopyMem (TempString, TempString + 1, StrSize (TempString + 1));\r
-  }\r
-\r
   return Path;\r
 }\r
 \r