]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/commands/menuentry.c (grub_cmd_menuentry): Correctly
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 14 May 2011 10:14:00 +0000 (12:14 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 14 May 2011 10:14:00 +0000 (12:14 +0200)
handle class-free menuentries.
(grub_normal_add_menu_entry): Add a check to be sure.

ChangeLog
grub-core/commands/menuentry.c

index 398495dea85c27afdf01dfbcabe05dd97f4ac2ef..466713bfecb2e37c60da42a7f2763b3a3415b69a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-05-14  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/commands/menuentry.c (grub_cmd_menuentry): Correctly
+       handle class-free menuentries.
+       (grub_normal_add_menu_entry): Add a check to be sure.
+
 2011-05-14  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/term/at_keyboard.c (set1_e0_mapping): Fix swap between
index 4dab1783a2e9bad98b75a1fe168c01894f5a12f5..4849f8bb81cd27012a0ec6756e38827c4a584031 100644 (file)
@@ -91,7 +91,7 @@ grub_normal_add_menu_entry (int argc, const char **args, char **classes,
   if (! menu_sourcecode)
     return grub_errno;
 
-  if (classes)
+  if (classes && classes[0])
     {
       int i;
       for (i = 0; classes[i]; i++); /* count # of menuentry classes */
@@ -255,7 +255,8 @@ grub_cmd_menuentry (grub_extcmd_context_t ctxt, int argc, char **args)
 
   if (! ctxt->script)
     return grub_normal_add_menu_entry (argc, (const char **) args,
-                                      ctxt->state[0].args, ctxt->state[1].arg,
+                                      (ctxt->state[0].set ? ctxt->state[0].args
+                                       : NULL), ctxt->state[1].arg,
                                       ctxt->state[2].arg, 0,
                                       ctxt->state[3].arg,
                                       ctxt->extcmd->cmd->name[0] == 's');