]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseLib/FilePaths.c
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseLib / FilePaths.c
index d6f3758ecb10275ad12d33f39c0859ac74fa2144..40e8d773ce7f5943c25661d87916ebbbd8254bf4 100644 (file)
@@ -2,13 +2,8 @@
   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
@@ -85,6 +80,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
@@ -103,14 +105,9 @@ PathCleanUpDirectories(
         ) {\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