/** @file\r
Main file for Type shell level 3 function.\r
\r
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved. <BR>\r
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
#include <Library/ShellLib.h>\r
\r
+/**\r
+ Display a single file to StdOut.\r
+\r
+ If both Ascii and UCS2 are FALSE attempt to discover the file type.\r
+\r
+ @param[in] Handle The handle to the file to display.\r
+ @param[in] Ascii TRUE to force ASCII, FALSE othewise.\r
+ @param[in] UCS2 TRUE to force UCS2, FALSE othewise.\r
+\r
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.\r
+ @retval EFI_SUCCESS The operation was successful.\r
+**/\r
EFI_STATUS\r
EFIAPI\r
TypeFileByHandle (\r
CHAR16 AsciiChar;\r
\r
ReadSize = PcdGet16(PcdShellFileOperationSize);\r
- Buffer = AllocatePool(ReadSize);\r
+ Buffer = AllocateZeroPool(ReadSize);\r
if (Buffer == NULL) {\r
return (EFI_OUT_OF_RESOURCES);\r
}\r
}\r
\r
if (!(Ascii|UCS2)){\r
- if (*(UINT16*)Buffer == UnicodeFileTag) {\r
+ if (*(UINT16*)Buffer == gUnicodeFileTag) {\r
UCS2 = TRUE;\r
Buffer = ((UINT16*)Buffer) + 1;\r
} else {\r
Print(L"%s", Buffer);\r
}\r
}\r
- Status = Print(L"\r\n", Buffer);\r
+ Print(L"\r\n", Buffer);\r
return (Status);\r
}\r
\r
){\r
Status = ShellOpenFileMetaArg((CHAR16*)Param, EFI_FILE_MODE_READ, &FileList);\r
if (EFI_ERROR(Status)) {\r
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel3HiiHandle, (CHAR16*)Param);\r
ShellStatus = SHELL_NOT_FOUND;\r
break;\r
}\r