]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: Fix the last command doesn't work in a script.
authorQiu Shumin <shumin.qiu@intel.com>
Thu, 18 Feb 2016 05:12:58 +0000 (13:12 +0800)
committerQiu Shumin <shumin.qiu@intel.com>
Fri, 19 Feb 2016 07:00:57 +0000 (15:00 +0800)
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>
ShellPkg/Library/UefiShellLib/UefiShellLib.c

index abff0d31149185c855c9e68c06083b764f289c80..70852a93f298097023a1f49791f1911a9a414d1f 100644 (file)
@@ -2,7 +2,7 @@
   Provides interface to shell functionality for shell commands and applications.\r
 \r
   Copyright 2016 Dell Inc.\r
-  Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2016, 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
@@ -4071,6 +4071,9 @@ ShellFileHandleReturnLine(
     Status = ShellFileHandleReadLine(Handle, RetVal, &Size, FALSE, Ascii);\r
 \r
   }\r
+  if (Status == EFI_END_OF_FILE && *RetVal != CHAR_NULL) {\r
+    Status = EFI_SUCCESS;\r
+  }\r
   if (EFI_ERROR(Status) && (RetVal != NULL)) {\r
     FreePool(RetVal);\r
     RetVal = NULL;\r