summaryrefslogtreecommitdiff
path: root/ShellPkg
diff options
context:
space:
mode:
authorQiu Shumin <shumin.qiu@intel.com>2016-02-18 13:12:58 +0800
committerQiu Shumin <shumin.qiu@intel.com>2016-02-19 15:00:57 +0800
commitf79d7b62ba11db018db7bd489dd44051bfc067ae (patch)
treeb87c570d2edda30b13b51b4fcbe3fadd2b59121b /ShellPkg
parente665a69d9d222cceb925f6e2423e75ed7adabd42 (diff)
downloadedk2-platforms-f79d7b62ba11db018db7bd489dd44051bfc067ae.tar.xz
ShellPkg: Fix the last command doesn't work in a script.
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. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Library/UefiShellLib/UefiShellLib.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
index abff0d3114..70852a93f2 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;