Revision: 14186
          http://edk2.svn.sourceforge.net/edk2/?rev=14186&view=rev
Author:   oliviermartin
Date:     2013-03-12 00:57:05 +0000 (Tue, 12 Mar 2013)
Log Message:
-----------
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 <[email protected]>

Modified Paths:
--------------
    trunk/edk2/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c

Modified: trunk/edk2/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c
===================================================================
--- trunk/edk2/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c    2013-03-12 
00:56:37 UTC (rev 14185)
+++ trunk/edk2/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c    2013-03-12 
00:57:05 UTC (rev 14186)
@@ -155,8 +155,6 @@
   EFI_STATUS    Status   = EFI_SUCCESS;
   UINTN         SemihostHandle;
   CHAR8         *AsciiFileName;
-  CHAR8         *AsciiPtr;
-  UINTN         Length;
   UINT32        SemihostMode;
   BOOLEAN       IsRoot;
 
@@ -164,20 +162,13 @@
     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;
   }
+  UnicodeStrToAsciiStr (FileName, AsciiFileName);
 
-  AsciiPtr = AsciiFileName;
-
-  while (Length--) {
-    *AsciiPtr++ = *FileName++ & 0xFF;
-  }
-
   if ((AsciiStrCmp (AsciiFileName, "\\") == 0) ||
       (AsciiStrCmp (AsciiFileName, "/")  == 0) ||
       (AsciiStrCmp (AsciiFileName, "")   == 0) ||

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to