* 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.
This commit is contained in:
proski 2006-05-05 22:06:31 +00:00
parent b8aa16f505
commit 7a1b51024a
2 changed files with 10 additions and 2 deletions

View file

@ -1,5 +1,9 @@
2006-05-02 Pavel Roskin <proski@gnu.org> 2006-05-02 Pavel Roskin <proski@gnu.org>
* 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 * grub/main.c (main): Make sure the boot drive number doesn't
exceed 255. exceed 255.

View file

@ -651,7 +651,10 @@ restart:
*(new_heap++) = 0; *(new_heap++) = 0;
if (config_entries) 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 else
{ {
cls (); cls ();
@ -727,7 +730,8 @@ restart:
cur_entry = get_entry (config_entries, first_entry + entryno, 1); cur_entry = get_entry (config_entries, first_entry + entryno, 1);
/* Set CURRENT_ENTRYNO for the command "savedefault". */ /* 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)) if (run_script (cur_entry, heap))
{ {