summaryrefslogtreecommitdiff
path: root/ShellPkg/Application/Shell
diff options
context:
space:
mode:
authorJim_Dailey@Dell.com <Jim_Dailey@Dell.com>2016-03-01 13:02:19 -0800
committerHao Wu <hao.a.wu@intel.com>2016-07-13 20:42:10 +0800
commit02dabfa8b08a0e381e8c495fdc9d6f0c8efc4d7a (patch)
tree06746b2f5df752e5c961d5e04095a87415005584 /ShellPkg/Application/Shell
parent12990045fb7f0c74ec260f2907ae0d98b91660f4 (diff)
downloadedk2-platforms-02dabfa8b08a0e381e8c495fdc9d6f0c8efc4d7a.tar.xz
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 <jim_dailey@dell.com> Reviewed-by: Jaben Carsey <Jaben.Carsey@intel.com> (cherry picked from commit 0b966ddd61a90b3ba116c2eeaa93ee4247832a1a)
Diffstat (limited to 'ShellPkg/Application/Shell')
-rw-r--r--ShellPkg/Application/Shell/ShellParametersProtocol.c17
1 files changed, 6 insertions, 11 deletions
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);
}