]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: Don't strip BOM when piping UCS2 data to a UEFI app
authorJim_Dailey@Dell.com <Jim_Dailey@Dell.com>
Tue, 1 Mar 2016 21:02:19 +0000 (13:02 -0800)
committerJaben Carsey <jaben.carsey@intel.com>
Tue, 1 Mar 2016 21:37:19 +0000 (13:37 -0800)
If the BOM is stripped from StdIn, then an app that duplicates StdIn
will not be able to duplicate, say, a UCS2 file that was piped into
it (the output file it creates would not start with a BOM).

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jim Dailey <jim_dailey@dell.com>
Reviewed-by: Jaben Carsey <Jaben.Carsey@intel.com>
ShellPkg/Application/Shell/ShellParametersProtocol.c

index 56dd79214b3ad8363cb396190d06095cf91af560..c638583a3758a7161f3ecb0c9346afc52d1a52b2 100644 (file)
@@ -1265,18 +1265,13 @@ UpdateStdInStdOutStdErr(
           &TempHandle,\r
           EFI_FILE_MODE_READ,\r
           0);\r
-        if (InUnicode) {\r
-          //\r
-          // Chop off the 0xFEFF if it's there...\r
-          //\r
-          RemoveFileTag(&TempHandle);\r
-        } else if (!EFI_ERROR(Status)) {\r
-          //\r
-          // Create the ASCII->Unicode conversion layer\r
-          //\r
-          TempHandle = CreateFileInterfaceFile(TempHandle, FALSE);\r
-        }\r
         if (!EFI_ERROR(Status)) {\r
+          if (!InUnicode) {
+            //
+            // Create the ASCII->Unicode conversion layer
+            //
+            TempHandle = CreateFileInterfaceFile(TempHandle, FALSE);
+          }
           ShellParameters->StdIn = TempHandle;\r
           gST->ConIn = CreateSimpleTextInOnFile(TempHandle, &gST->ConsoleInHandle);\r
         }\r