File shim-clear-queued-key.patch of Package shim

From daa6a7519caa23ef69b9a879bc70789a0669b3e3 Mon Sep 17 00:00:00 2001
From: Gary Ching-Pang Lin <glin@suse.com>
Date: Wed, 26 Dec 2012 11:44:46 +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;
-- 
1.7.10.4

openSUSE Build Service is sponsored by