aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Bottomley <JBottomley@Parallels.com>2013-01-20 12:14:09 +0000
committerJames Bottomley <JBottomley@Parallels.com>2013-01-20 12:14:09 +0000
commitdab7e37194082469c7e740ef8ab3c79ba8d011de (patch)
treef09f17d93c59383517cf5818ed273b232a1124c7
parentca9f820a9f199fd39a84338cdfba95ccbf65749c (diff)
downloadefitools-dab7e37194082469c7e740ef8ab3c79ba8d011de.tar.gz
console: fix bug where ESC isn't properly propagated
In a long selector, if you scroll down, ESC isn't reported correctly. Fix By making sure -1 is returned instead of adding it to the offset. Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r--lib/console.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/console.c b/lib/console.c
index 1aff1d0..ee323eb 100644
--- a/lib/console.c
+++ b/lib/console.c
@@ -264,6 +264,9 @@ console_select(CHAR16 *title[], CHAR16* selectors[], int start)
uefi_call_wrapper(co->SetCursorPosition, 3, co, SavedConsoleMode.CursorColumn, SavedConsoleMode.CursorRow);
uefi_call_wrapper(co->SetAttribute, 2, co, SavedConsoleMode.Attribute);
+ if (selector < 0)
+ /* ESC pressed */
+ return selector;
return selector + selector_offset;
}