diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2010-12-29 13:25:18 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2010-12-29 13:25:18 -0500 |
commit | 551caa21eb8fa4f7cd2971e48999b60f3619b519 (patch) | |
tree | 861847d55f72081694fcbfdf197bd7ff872fff0c | |
parent | 697e63c914a13b0c4a4ac0150d39ea3591bb9e31 (diff) | |
download | seabios-551caa21eb8fa4f7cd2971e48999b60f3619b519.zip seabios-551caa21eb8fa4f7cd2971e48999b60f3619b519.tar.gz seabios-551caa21eb8fa4f7cd2971e48999b60f3619b519.tar.bz2 |
Simplify keyboard reading code in the interactive boot menu.
-rw-r--r-- | src/boot.c | 32 |
1 files changed, 16 insertions, 16 deletions
@@ -275,27 +275,27 @@ interactive_bootmenu(void) pos = pos->next; } + // Get key press for (;;) { scan_code = get_keystroke(1000); - if (scan_code == 0x01) - // ESC + if (scan_code >= 1 && scan_code <= maxmenu+1) break; - if (scan_code < 1 || scan_code > maxmenu+1) - continue; - int choice = scan_code - 1; - - // Find entry and make top priority. - struct bootentry_s **pprev = &BootList; - while (--choice) - pprev = &(*pprev)->next; - pos = *pprev; - *pprev = pos->next; - pos->next = BootList; - BootList = pos; - pos->priority = 0; - break; } printf("\n"); + if (scan_code == 0x01) + // ESC + return; + + // Find entry and make top priority. + int choice = scan_code - 1; + struct bootentry_s **pprev = &BootList; + while (--choice) + pprev = &(*pprev)->next; + pos = *pprev; + *pprev = pos->next; + pos->next = BootList; + BootList = pos; + pos->priority = 0; } static int HaveHDBoot, HaveFDBoot; |