From: Pedroa Liu Date: Mon, 16 May 2016 12:48:41 +0000 (+0800) Subject: ShellPkg: Fix the incorrect behavior when pressing 'shift' key. X-Git-Tag: edk2-stable201903~7021 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=b8f3601daae5c8b50ca6f7da74bb150f2eef9453;p=mirror_edk2.git ShellPkg: Fix the incorrect behavior when pressing 'shift' key. 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 Reviewed-by: Qiu Shumin --- diff --git a/ShellPkg/Application/Shell/FileHandleWrappers.c b/ShellPkg/Application/Shell/FileHandleWrappers.c index 0e5efe3025..f64915d9ed 100644 --- a/ShellPkg/Application/Shell/FileHandleWrappers.c +++ b/ShellPkg/Application/Shell/FileHandleWrappers.c @@ -422,6 +422,12 @@ FileInterfaceStdInRead( gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex); Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key); if (EFI_ERROR (Status)) { + + if (Status == EFI_NOT_READY) + continue; + + ZeroMem (CurrentString, MaxStr * sizeof(CHAR16)); + StringLen = 0; break; }