/** @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
#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
L'\' to a CHAR_NULL.\r
\r
- @param[in,out] Path The pointer to the path to modify.\r
+ @param[in, out] Path The pointer to the path to modify.\r
\r
@retval FALSE Nothing was found to remove.\r
@retval TRUE A directory or file was removed.\r
}\r
\r
//\r
- // Fix up the / vs \\r
+ // Fix up the '/' vs '\'\r
//\r
for (TempString = Path ; TempString != NULL && *TempString != CHAR_NULL ; TempString++) {\r
if (*TempString == L'/') {\r
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