From d4de6b01e8953039b84205d5ac181cb3615d726e Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sat, 14 May 2011 12:14:00 +0200 Subject: [PATCH] * grub-core/commands/menuentry.c (grub_cmd_menuentry): Correctly handle class-free menuentries. (grub_normal_add_menu_entry): Add a check to be sure. --- ChangeLog | 6 ++++++ grub-core/commands/menuentry.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 398495dea..466713bfe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-05-14 Vladimir Serbinenko + + * 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 * grub-core/term/at_keyboard.c (set1_e0_mapping): Fix swap between diff --git a/grub-core/commands/menuentry.c b/grub-core/commands/menuentry.c index 4dab1783a..4849f8bb8 100644 --- a/grub-core/commands/menuentry.c +++ b/grub-core/commands/menuentry.c @@ -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');