]> git.proxmox.com Git - efi-boot-shim.git/commitdiff
Make sure the menu shows when the callback fails
authorGary Ching-Pang Lin <glin@suse.com>
Thu, 3 Jan 2013 04:20:30 +0000 (12:20 +0800)
committerGary Ching-Pang Lin <glin@suse.com>
Thu, 3 Jan 2013 04:20:30 +0000 (12:20 +0800)
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

index bfcbfd6768d3f2d3da8e906af6d07b389895ca55..97588cb66f227d9b25212494478d7cb94749cc8a 100644 (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;