From 0b966ddd61a90b3ba116c2eeaa93ee4247832a1a Mon Sep 17 00:00:00 2001 From: "Jim_Dailey@Dell.com" Date: Tue, 1 Mar 2016 13:02:19 -0800 Subject: ShellPkg: Don't strip BOM when piping UCS2 data to a UEFI app 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 Reviewed-by: Jaben Carsey --- ShellPkg/Application/Shell/ShellParametersProtocol.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'ShellPkg') diff --git a/ShellPkg/Application/Shell/ShellParametersProtocol.c b/ShellPkg/Application/Shell/ShellParametersProtocol.c index 56dd79214b..c638583a37 100644 --- a/ShellPkg/Application/Shell/ShellParametersProtocol.c +++ b/ShellPkg/Application/Shell/ShellParametersProtocol.c @@ -1265,18 +1265,13 @@ UpdateStdInStdOutStdErr( &TempHandle, EFI_FILE_MODE_READ, 0); - if (InUnicode) { - // - // Chop off the 0xFEFF if it's there... - // - RemoveFileTag(&TempHandle); - } else if (!EFI_ERROR(Status)) { - // - // Create the ASCII->Unicode conversion layer - // - TempHandle = CreateFileInterfaceFile(TempHandle, FALSE); - } if (!EFI_ERROR(Status)) { + if (!InUnicode) { + // + // Create the ASCII->Unicode conversion layer + // + TempHandle = CreateFileInterfaceFile(TempHandle, FALSE); + } ShellParameters->StdIn = TempHandle; gST->ConIn = CreateSimpleTextInOnFile(TempHandle, &gST->ConsoleInHandle); } -- cgit v1.2.3