]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: Fix the incorrect behavior when pressing 'shift' key.
authorPedroa Liu <pedroa.liu@insyde.com>
Mon, 16 May 2016 12:48:41 +0000 (20:48 +0800)
committerQiu Shumin <shumin.qiu@intel.com>
Wed, 18 May 2016 01:41:29 +0000 (09:41 +0800)
If 'ReadKeyStroke' function return EFI_NOT_READY then skip it.
If the return value is EFI_DEVICE_ERROR clean the currentString buffer.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Pedroa Liu <pedroa.liu@insyde.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
ShellPkg/Application/Shell/FileHandleWrappers.c

index 0e5efe30255631f36b972715c49a464970f88677..f64915d9ed33f2501cd75ee268c166dbb8779872 100644 (file)
@@ -422,6 +422,12 @@ FileInterfaceStdInRead(
     gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);\r
     Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);\r
     if (EFI_ERROR (Status)) {\r
+\r
+      if (Status == EFI_NOT_READY)\r
+        continue;\r
+\r
+      ZeroMem (CurrentString, MaxStr * sizeof(CHAR16));\r
+      StringLen = 0;\r
       break;\r
     }\r
 \r