Branch: refs/heads/master
Home: https://github.com/tianocore/edk2
Commit: d2a0d2e6acea4d6a3dbe31b68a9a7fe7511cb478
https://github.com/tianocore/edk2/commit/d2a0d2e6acea4d6a3dbe31b68a9a7fe7511cb478
Author: jaben carsey <[email protected]>
Date: 2016-02-08 (Mon, 08 Feb 2016)
Changed paths:
M ShellPkg/Application/Shell/FileHandleWrappers.c
M ShellPkg/Include/Library/ShellLib.h
M ShellPkg/Library/UefiShellLib/UefiShellLib.c
M ShellPkg/Library/UefiShellLib/UefiShellLib.inf
Log Message:
-----------
ShellPkg: Fix ASCII and UNICODE file pipes.
Fix various errors when piping a UNICODE or ASCII file to a simple shell
application that reads standard input and writes it to standard output.
1) When the memory file is created by CreateFileInferfaceMem() to capture the
pipe output, no UNICODE BOM is written to the memory file. Later, when the
memory file is read by the application using ShellFileHandleReadLine(), the
function indicates that the file is ASCII because there is no BOM.
2) If the file is piped as ASCII, the ASCII memory image is not correctly
created by FileInterfaceMemWrite() as each ASCII character is followed by '\0'
in the image (when the ASCII data is written to the memory image, the file
position should only be incremented by half the buffer size).
3) ShellFileHandleReadLine() does not read ASCII files correctly (writes to
Buffer need to be cast as CHAR8*).
4) FileInterfaceMemRead() and FileInterfaceMemWrite() as somewhat hard to read
and difficult to debug with certain tools due to the typecasting of This. Added
a local variable (MemFile) of the correct type to these functions and used it
instead of This.
Enhancement: ShellFileHandleReadLine() now returns EFI_END_OF_FILE when
appropriate.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jim Dailey <[email protected]>
reviewed-by: Jaben Carsey <[email protected]>
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits