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;
|
EFI_STATUS Status = EFI_SUCCESS;
|
||||||
UINTN SemihostHandle;
|
UINTN SemihostHandle;
|
||||||
CHAR8 *AsciiFileName;
|
CHAR8 *AsciiFileName;
|
||||||
CHAR8 *AsciiPtr;
|
|
||||||
UINTN Length;
|
|
||||||
UINT32 SemihostMode;
|
UINT32 SemihostMode;
|
||||||
BOOLEAN IsRoot;
|
BOOLEAN IsRoot;
|
||||||
|
|
||||||
|
@ -164,19 +162,12 @@ FileOpen (
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Semihost interface requires ASCII filesnames
|
// Semihost interface requires ASCII filenames
|
||||||
Length = StrSize (FileName);
|
AsciiFileName = AllocatePool ((StrLen (FileName) + 1) * sizeof (CHAR8));
|
||||||
|
|
||||||
AsciiFileName = AllocatePool (Length);
|
|
||||||
if (AsciiFileName == NULL) {
|
if (AsciiFileName == NULL) {
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
UnicodeStrToAsciiStr (FileName, AsciiFileName);
|
||||||
AsciiPtr = AsciiFileName;
|
|
||||||
|
|
||||||
while (Length--) {
|
|
||||||
*AsciiPtr++ = *FileName++ & 0xFF;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((AsciiStrCmp (AsciiFileName, "\\") == 0) ||
|
if ((AsciiStrCmp (AsciiFileName, "\\") == 0) ||
|
||||||
(AsciiStrCmp (AsciiFileName, "/") == 0) ||
|
(AsciiStrCmp (AsciiFileName, "/") == 0) ||
|
||||||
|
|
Loading…
Reference in New Issue