readline: Fix issue where timeouts were not reported properly on BIOS
diff --git a/stage23/lib/sleep.asm b/stage23/lib/sleep.asm
index d1abe6ab..fc1c4dd0 100644
--- a/stage23/lib/sleep.asm
+++ b/stage23/lib/sleep.asm
@@ -119,6 +119,9 @@ _pit_sleep_and_quit_on_keypress:
mov edx, dword [int_08_callback]
mov dword [0x08*4], edx
+ test eax, eax
+ jz .out
+
xor edx, edx
mov dl, ah
xor ah, ah
@@ -128,6 +131,7 @@ _pit_sleep_and_quit_on_keypress:
pop edx
pop edx
+ .out:
ret
.gdt: dq 0
