]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2006-12-11 Marco Gerards <marco@gnu.org>
authormarco_g <marco_g@localhost>
Mon, 11 Dec 2006 21:00:06 +0000 (21:00 +0000)
committermarco_g <marco_g@localhost>
Mon, 11 Dec 2006 21:00:06 +0000 (21:00 +0000)
* normal/menu_entry.c (run): Fix off by one bug so the last line
is executed.  Move the loader check to outside the loop.

ChangeLog
normal/menu_entry.c

index 4bedee20101bbbcd3a104ce6dd831654c8e49197..e74884d84f31d310872ce96e2ec887fd07b94a53 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-12-11  Marco Gerards  <marco@gnu.org>
+
+       * normal/menu_entry.c (run): Fix off by one bug so the last line
+       is executed.  Move the loader check to outside the loop.
+
 2006-12-08  Hollis Blanchard  <hollis@penguinppc.org>
 
        * kern/powerpc/ieee1275/cmain.c (cmain): Mark r3 and r4 as `UNUSED'.
index 9bc6bba1ed98d2b0b74a7bb90f927d4c3e1d3940..a0597d36e657a7c52e08bf889ac0be8998f2838d 100644 (file)
@@ -1007,7 +1007,7 @@ run (struct screen *screen)
 
 
   /* Execute the script, line for line.  */
-  while (currline < screen->num_lines - 1)
+  while (currline < screen->num_lines)
     {
       editor_getline (&nextline);
       parsed_script = grub_script_parse (nextline, editor_getline);
@@ -1018,15 +1018,15 @@ run (struct screen *screen)
          
          /* The parsed script was executed, throw it away.  */
          grub_script_free (parsed_script);
-
-         if (grub_errno == GRUB_ERR_NONE && grub_loader_is_loaded ())
-           /* Implicit execution of boot, only if something is loaded.  */
-           grub_command_execute ("boot", 0);
        }
       else
        break;
     }
 
+  if (grub_errno == GRUB_ERR_NONE && grub_loader_is_loaded ())
+    /* Implicit execution of boot, only if something is loaded.  */
+    grub_command_execute ("boot", 0);
+
   if (grub_errno != GRUB_ERR_NONE)
     {
       grub_print_error ();