]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* stage2/stage2.c (run_menu): Fix "savedefault" to save only top
authorproski <proski@localhost>
Fri, 5 May 2006 22:06:31 +0000 (22:06 +0000)
committerproski <proski@localhost>
Fri, 5 May 2006 22:06:31 +0000 (22:06 +0000)
level menu positions.  Remember current position when calling a
submenu.  Don't recalculate it when booting from a submenu.

ChangeLog
stage2/stage2.c

index 9d29366636019fadd128a1e6039eeabd553c3cdf..5260219349a601835005314446e3511b1bec93a9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 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
        exceed 255.
 
index 4dbf6f59c4ab8ee22a4ecaa82a1f19679f9134fe..040c22dd6cb542e0d7c23d49e32af5e12244afed 100644 (file)
@@ -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))
        {