When the last line in a script file is not an empty line the Shell will not execute the command in the last line. The patch refine the logic in function 'ShellFileHandleReturnLine' and fix the issue.
Cc: Qiu Shumin <shumin....@intel.com> Cc: Jaben Carsey <jaben.car...@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jaben Carsey <jaben.car...@intel.com> Reviewed-by: Qiu Shumin <shumin....@intel.com> --- ShellPkg/Library/UefiShellLib/UefiShellLib.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/UefiShellLib/UefiShellLib.c index abff0d3..70852a9 100644 --- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c +++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c @@ -2,7 +2,7 @@ Provides interface to shell functionality for shell commands and applications. Copyright 2016 Dell Inc. - Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR> + Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -4071,6 +4071,9 @@ ShellFileHandleReturnLine( Status = ShellFileHandleReadLine(Handle, RetVal, &Size, FALSE, Ascii); } + if (Status == EFI_END_OF_FILE && *RetVal != CHAR_NULL) { + Status = EFI_SUCCESS; + } if (EFI_ERROR(Status) && (RetVal != NULL)) { FreePool(RetVal); RetVal = NULL; -- 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel