mirror of https://github.com/acidanthera/audk.git
ArmPkg/SemihostFs: Use Unicode to Ascii function for the conversion
The Unicode to Ascii string conversion was done manually. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14186 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
bc87b5075a
commit
ed2405a0ed
|
@ -155,8 +155,6 @@ FileOpen (
|
|||
EFI_STATUS Status = EFI_SUCCESS;
|
||||
UINTN SemihostHandle;
|
||||
CHAR8 *AsciiFileName;
|
||||
CHAR8 *AsciiPtr;
|
||||
UINTN Length;
|
||||
UINT32 SemihostMode;
|
||||
BOOLEAN IsRoot;
|
||||
|
||||
|
@ -164,19 +162,12 @@ FileOpen (
|
|||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
// Semihost interface requires ASCII filesnames
|
||||
Length = StrSize (FileName);
|
||||
|
||||
AsciiFileName = AllocatePool (Length);
|
||||
// Semihost interface requires ASCII filenames
|
||||
AsciiFileName = AllocatePool ((StrLen (FileName) + 1) * sizeof (CHAR8));
|
||||
if (AsciiFileName == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
AsciiPtr = AsciiFileName;
|
||||
|
||||
while (Length--) {
|
||||
*AsciiPtr++ = *FileName++ & 0xFF;
|
||||
}
|
||||
UnicodeStrToAsciiStr (FileName, AsciiFileName);
|
||||
|
||||
if ((AsciiStrCmp (AsciiFileName, "\\") == 0) ||
|
||||
(AsciiStrCmp (AsciiFileName, "/") == 0) ||
|
||||
|
|
Loading…
Reference in New Issue