summaryrefslogtreecommitdiff
path: root/EdkNt32Pkg/Dxe
diff options
context:
space:
mode:
authorxgu3 <xgu3@6f19259b-4bc3-4df7-8a09-765794883524>2006-08-10 12:53:55 +0000
committerxgu3 <xgu3@6f19259b-4bc3-4df7-8a09-765794883524>2006-08-10 12:53:55 +0000
commit4224ac208726ee643afc2d3712b6bf4b86184fb4 (patch)
tree7ffe4173a151583f9b85bc4dcd6d200d7a24edd9 /EdkNt32Pkg/Dxe
parent202c5d55e5a5a1f065038cda8316ad36293aa6bb (diff)
downloadedk2-4224ac208726ee643afc2d3712b6bf4b86184fb4.zip
edk2-4224ac208726ee643afc2d3712b6bf4b86184fb4.tar.gz
edk2-4224ac208726ee643afc2d3712b6bf4b86184fb4.tar.bz2
Fix BDS boot from file . and .. fail assertion
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1237 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkNt32Pkg/Dxe')
-rw-r--r--EdkNt32Pkg/Dxe/PlatformBds/Generic/BootMaint/BootOption.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/EdkNt32Pkg/Dxe/PlatformBds/Generic/BootMaint/BootOption.c b/EdkNt32Pkg/Dxe/PlatformBds/Generic/BootMaint/BootOption.c
index 13e8275..57b5239 100644
--- a/EdkNt32Pkg/Dxe/PlatformBds/Generic/BootMaint/BootOption.c
+++ b/EdkNt32Pkg/Dxe/PlatformBds/Generic/BootMaint/BootOption.c
@@ -1056,6 +1056,27 @@ Returns:
}
CHAR16 *
+BdsStrCpy (
+ OUT CHAR16 *Destination,
+ IN CONST CHAR16 *Source
+ )
+{
+ CHAR16 *ReturnValue;
+
+ //
+ // Destination cannot be NULL
+ //
+ ASSERT (Destination != NULL);
+
+ ReturnValue = Destination;
+ while (*Source) {
+ *(Destination++) = *(Source++);
+ }
+ *Destination = 0;
+ return ReturnValue;
+}
+
+CHAR16 *
BOpt_AppendFileName (
IN CHAR16 *Str1,
IN CHAR16 *Str2
@@ -1102,13 +1123,13 @@ Returns:
// DO NOT convert the .. if it is at the end of the string. This will
// break the .. behavior in changing directories.
//
- StrCpy (LastSlash, Ptr + 3);
+ BdsStrCpy (LastSlash, Ptr + 3);
Ptr = LastSlash;
} else if (*Ptr == '\\' && *(Ptr + 1) == '.' && *(Ptr + 2) == '\\') {
//
// Convert a \.\ to a \
//
- StrCpy (Ptr, Ptr + 2);
+ BdsStrCpy (Ptr, Ptr + 2);
Ptr = LastSlash;
} else if (*Ptr == '\\') {
LastSlash = Ptr;