minor fix
This commit is contained in:
parent
45ab4f486f
commit
b4cd82945a
1 changed files with 4 additions and 4 deletions
|
@ -47,9 +47,6 @@ grub_script_cmd_shift (grub_command_t cmd __attribute__((unused)),
|
||||||
if (! scope)
|
if (! scope)
|
||||||
return GRUB_ERR_NONE;
|
return GRUB_ERR_NONE;
|
||||||
|
|
||||||
if (scope->argv.argc == 0)
|
|
||||||
return GRUB_ERR_NONE;
|
|
||||||
|
|
||||||
if (argc == 0)
|
if (argc == 0)
|
||||||
n = 1;
|
n = 1;
|
||||||
|
|
||||||
|
@ -59,10 +56,13 @@ grub_script_cmd_shift (grub_command_t cmd __attribute__((unused)),
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
n = grub_strtoul (argv[0], &p, 10);
|
n = grub_strtoul (argv[0], &p, 10);
|
||||||
if (*p != '\0' || n > scope->argv.argc)
|
if (*p != '\0')
|
||||||
return GRUB_ERR_BAD_ARGUMENT;
|
return GRUB_ERR_BAD_ARGUMENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (n > scope->argv.argc)
|
||||||
|
return GRUB_ERR_BAD_ARGUMENT;
|
||||||
|
|
||||||
scope->argv.argc -= n;
|
scope->argv.argc -= n;
|
||||||
scope->argv.args += n;
|
scope->argv.args += n;
|
||||||
return GRUB_ERR_NONE;
|
return GRUB_ERR_NONE;
|
||||||
|
|
Loading…
Reference in a new issue