:: commit 4e1f238b375725dfc25d9286a671d76a5646eb44

czapek1337 <czapek1337@gmail.com> — 2022-10-06 03:37

parents: 101e480dbf

readline: Fallback to SystemTable->ConIn

diff --git a/common/lib/readline.c b/common/lib/readline.c
index c523a58c..a66a8430 100644
--- a/common/lib/readline.c
+++ b/common/lib/readline.c
@@ -267,7 +267,11 @@ int pit_sleep_and_quit_on_keypress(int seconds) {
 
     if (gBS->HandleProtocol(gST->ConsoleInHandle, &exproto_guid, (void **)&exproto) != EFI_SUCCESS) {
         if (gBS->HandleProtocol(gST->ConsoleInHandle, &sproto_guid, (void **)&sproto) != EFI_SUCCESS) {
-            panic(false, "Your input device doesn't have an input protocol!");
+            if (gST->ConIn != NULL) {
+                sproto = gST->ConIn;
+            } else {
+                panic(false, "Your input device doesn't have an input protocol!");
+            }
         }
 
         events[0] = sproto->WaitForKey;
tab: 248 wrap: offon