]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/BasePathLib/BasePathLib.c
MdeModulePkg/PartitionDxe: Fixed El Torito support when the medium is not a CDROM
[mirror_edk2.git] / ShellPkg / Library / BasePathLib / BasePathLib.c
index 77d5866a817af43a5b144c76759d9b230bb7ccef..301bd3b279a17e749828c026f96c75e5bfe57085 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Provides interface to path manipulation functions.\r
 \r
-  Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2011 - 2014, 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
@@ -15,6 +15,7 @@
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/PathLib.h>\r
 #include <Library/BaseLib.h>\r
+#include <Protocol/SimpleTextIn.h> \r
 \r
 /**\r
   Removes the last directory or file entry in a path by changing the last\r
@@ -112,10 +113,18 @@ PathCleanUpDirectories(
     CopyMem(Path+StrLen(Path), TempString, TempSize);\r
   }\r
   if ((TempString = StrStr(Path, L"\\.")) != NULL && *(TempString + 2) == CHAR_NULL) {\r
-    *TempString = CHAR_NULL;\r
+    *(TempString + 1) = CHAR_NULL;\r
   }\r
 \r
-\r
+  while ((TempString = StrStr(Path, L"\\\\")) != NULL) {\r
+    *TempString = CHAR_NULL;\r
+    TempString  += 1;\r
+    TempSize = StrSize(TempString);\r
+    CopyMem(Path+StrLen(Path), TempString, TempSize);\r
+  }\r
+  if ((TempString = StrStr(Path, L"\\\\")) != NULL && *(TempString + 1) == CHAR_NULL) {\r
+    *(TempString) = CHAR_NULL;\r
+  }\r
 \r
   return (Path);\r
 }\r