From 7a1b51024aaaab4b90251d0904414a29e77256db Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 5 May 2006 22:06:31 +0000 Subject: [PATCH] * stage2/stage2.c (run_menu): Fix "savedefault" to save only top level menu positions. Remember current position when calling a submenu. Don't recalculate it when booting from a submenu. --- ChangeLog | 4 ++++ stage2/stage2.c | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9d2936663..526021934 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-05-02 Pavel Roskin + * stage2/stage2.c (run_menu): Fix "savedefault" to save only top + level menu positions. Remember current position when calling a + submenu. Don't recalculate it when booting from a submenu. + * grub/main.c (main): Make sure the boot drive number doesn't exceed 255. diff --git a/stage2/stage2.c b/stage2/stage2.c index 4dbf6f59c..040c22dd6 100644 --- a/stage2/stage2.c +++ b/stage2/stage2.c @@ -651,7 +651,10 @@ restart: *(new_heap++) = 0; if (config_entries) - run_menu (heap, NULL, new_num_entries, new_heap, 0); + { + current_entryno = first_entry + entryno; + run_menu (heap, NULL, new_num_entries, new_heap, 0); + } else { cls (); @@ -727,7 +730,8 @@ restart: cur_entry = get_entry (config_entries, first_entry + entryno, 1); /* Set CURRENT_ENTRYNO for the command "savedefault". */ - current_entryno = first_entry + entryno; + if (config_entries) + current_entryno = first_entry + entryno; if (run_script (cur_entry, heap)) {