diff --git a/MdePkg/Library/BaseLib/FilePaths.c b/MdePkg/Library/BaseLib/FilePaths.c index ce6b3720d5..92e4c350ff 100644 --- a/MdePkg/Library/BaseLib/FilePaths.c +++ b/MdePkg/Library/BaseLib/FilePaths.c @@ -86,6 +86,13 @@ PathCleanUpDirectories( } } + // + // Replace the "\\" with "\" + // + while ((TempString = StrStr (Path, L"\\\\")) != NULL) { + CopyMem (TempString, TempString + 1, StrSize (TempString + 1)); + } + // // Remove all the "\.". E.g.: fs0:\abc\.\def\. // @@ -109,13 +116,6 @@ PathCleanUpDirectories( } } - // - // Replace the "\\" with "\" - // - while ((TempString = StrStr (Path, L"\\\\")) != NULL) { - CopyMem (TempString, TempString + 1, StrSize (TempString + 1)); - } - return Path; }