From 4a88de5816a7ac416d30dbd66e5117f5d4c2c74d Mon Sep 17 00:00:00 2001 From: Gary Ching-Pang Lin Date: Thu, 3 Jan 2013 12:20:30 +0800 Subject: [PATCH] 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. --- MokManager.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MokManager.c b/MokManager.c index bfcbfd6..97588cb 100644 --- a/MokManager.c +++ b/MokManager.c @@ -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;