]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix BDS boot from file . and .. fail assertion
authorxgu3 <xgu3@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 10 Aug 2006 12:53:55 +0000 (12:53 +0000)
committerxgu3 <xgu3@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 10 Aug 2006 12:53:55 +0000 (12:53 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1237 6f19259b-4bc3-4df7-8a09-765794883524

EdkNt32Pkg/Dxe/PlatformBds/Generic/BootMaint/BootOption.c

index 13e82759e12d5bee532b22b0cd73b709d42f45cc..57b5239530c76876ff8ff8d08aafb88ee93e3ebc 100644 (file)
@@ -1055,6 +1055,27 @@ Returns:
   return MenuCount;\r
 }\r
 \r
+CHAR16 *\r
+BdsStrCpy (\r
+  OUT     CHAR16                    *Destination,\r
+  IN      CONST CHAR16              *Source\r
+  )\r
+{\r
+  CHAR16                            *ReturnValue;\r
+\r
+  //\r
+  // Destination cannot be NULL\r
+  //\r
+  ASSERT (Destination != NULL);\r
+\r
+  ReturnValue = Destination;\r
+  while (*Source) {\r
+    *(Destination++) = *(Source++);\r
+  }\r
+  *Destination = 0;\r
+  return ReturnValue;\r
+}\r
+\r
 CHAR16 *\r
 BOpt_AppendFileName (\r
   IN  CHAR16  *Str1,\r
@@ -1102,13 +1123,13 @@ Returns:
       // DO NOT convert the .. if it is at the end of the string. This will\r
       // break the .. behavior in changing directories.\r
       //\r
-      StrCpy (LastSlash, Ptr + 3);\r
+      BdsStrCpy (LastSlash, Ptr + 3);\r
       Ptr = LastSlash;\r
     } else if (*Ptr == '\\' && *(Ptr + 1) == '.' && *(Ptr + 2) == '\\') {\r
       //\r
       // Convert a \.\ to a \\r
       //\r
-      StrCpy (Ptr, Ptr + 2);\r
+      BdsStrCpy (Ptr, Ptr + 2);\r
       Ptr = LastSlash;\r
     } else if (*Ptr == '\\') {\r
       LastSlash = Ptr;\r