* grub-core/lib/arg.c (grub_arg_parse): Avoid interpreting direct

argument as an argument to no-argument option.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-11-01 12:45:51 +01:00
parent f8729d984a
commit 6428dec358
2 changed files with 15 additions and 7 deletions

View file

@ -1,3 +1,8 @@
2010-11-01 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/lib/arg.c (grub_arg_parse): Avoid interpreting direct
argument as an argument to no-argument option.
2010-11-01 Vladimir Serbinenko <phcoder@gmail.com>
* util/grub.d/10_linux.in: Add missing load_video with explicit

View file

@ -340,17 +340,20 @@ grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv,
}
option = grub_strchr (arg, '=');
if (option) {
arglen = option - arg - 2;
option++;
} else {
if (option)
{
arglen = option - arg - 2;
option++;
}
else
arglen = grub_strlen (arg) - 2;
if (argv[curarg + 1])
option = argv[curarg + 1][0] == '-' ? 0 : argv[++curarg];
}
opt = find_long (cmd->options, arg + 2, arglen);
if (!option && argv[curarg + 1] && argv[curarg + 1][0] != '-'
&& opt->type != ARG_TYPE_NONE)
option = argv[++curarg];
if (!opt && (cmd->cmd->flags & GRUB_COMMAND_ACCEPT_DASH))
{
if (add_arg (arg) != 0)