Make sure the menu shows when the callback fails

Since Pause() doesn't clear the key from the input queue, the next
ReadKeyStroke reads the queued key instead of the new one. If the
user presses "Enter", MokManager exits directly without showing
the menu again.
This commit is contained in:
Gary Ching-Pang Lin 2013-01-03 12:20:30 +08:00
parent 92a136d823
commit 4a88de5816

View File

@ -1241,6 +1241,9 @@ static void run_menu (CHAR16 *header, UINTN lines, struct menu_item *items,
if (ret < 0) {
Print(L"Press a key to continue\n");
Pause();
/* Clear the key in the queue */
uefi_call_wrapper(ST->ConIn->ReadKeyStroke, 2,
ST->ConIn, &key);
}
draw_menu (header, lines, items, count);
pos = 0;