full menuentry command support
This commit is contained in:
parent
004f491eed
commit
b14906860b
2 changed files with 6 additions and 5 deletions
|
@ -40,9 +40,7 @@ grub_extcmd_dispatcher (struct grub_command *cmd, int argc, char **args,
|
||||||
context.extcmd = ext;
|
context.extcmd = ext;
|
||||||
context.script_params = scripts;
|
context.script_params = scripts;
|
||||||
|
|
||||||
/* Dynamic commands should not perform option parsing before
|
if (! ext->options)
|
||||||
corresponding module gets loaded. */
|
|
||||||
if (cmd->flags & GRUB_COMMAND_FLAG_DYNCMD)
|
|
||||||
{
|
{
|
||||||
ret = (ext->func) (&context, argc, args);
|
ret = (ext->func) (&context, argc, args);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -65,7 +63,6 @@ grub_extcmd_dispatcher (struct grub_command *cmd, int argc, char **args,
|
||||||
ret = grub_errno;
|
ret = grub_errno;
|
||||||
|
|
||||||
grub_free (state);
|
grub_free (state);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ static grub_err_t
|
||||||
grub_cmd_menuentry (grub_extcmd_context_t ctxt, int argc, char **args)
|
grub_cmd_menuentry (grub_extcmd_context_t ctxt, int argc, char **args)
|
||||||
{
|
{
|
||||||
char *src;
|
char *src;
|
||||||
|
unsigned len;
|
||||||
grub_err_t r;
|
grub_err_t r;
|
||||||
|
|
||||||
/* XXX Rewrite to make use of already parsed menu definition. */
|
/* XXX Rewrite to make use of already parsed menu definition. */
|
||||||
|
@ -37,9 +38,12 @@ grub_cmd_menuentry (grub_extcmd_context_t ctxt, int argc, char **args)
|
||||||
|
|
||||||
src = args[argc - 1];
|
src = args[argc - 1];
|
||||||
args[argc - 1] = '\0';
|
args[argc - 1] = '\0';
|
||||||
|
len = grub_strlen(src);
|
||||||
|
src[len - 1] = '\0';
|
||||||
|
|
||||||
r = grub_normal_add_menu_entry (argc - 1, (const char **) args, src);
|
r = grub_normal_add_menu_entry (argc - 1, (const char **) args, src + 1);
|
||||||
|
|
||||||
|
src[len - 1] = '}';
|
||||||
args[argc - 1] = src;
|
args[argc - 1] = src;
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue