Defines file-path manipulation functions.\r
\r
Copyright (c) 2011 - 2017, 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
- http://opensource.org/licenses/bsd-license.php.\r
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+ Copyright (c) 2018, Dell Technologies. All rights reserved.<BR>\r
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
**/\r
#include <Library/BaseMemoryLib.h>\r
#include <Library/BaseLib.h>\r
}\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
) {\r
*(TempString + 1) = CHAR_NULL;\r
PathRemoveLastItem(Path);\r
- CopyMem (Path + StrLen (Path), TempString + 3, StrSize (TempString + 3));\r
- }\r
-\r
- //\r
- // Replace the "\\" with "\"\r
- //\r
- while ((TempString = StrStr (Path, L"\\\\")) != NULL) {\r
- CopyMem (TempString, TempString + 1, StrSize (TempString + 1));\r
+ if (*(TempString + 3) != CHAR_NULL) {\r
+ CopyMem (Path + StrLen (Path), TempString + 4, StrSize (TempString + 4));\r
+ }\r
}\r
\r
return Path;\r