minor fix

This commit is contained in:
BVK Chaitanya 2010-05-12 17:43:49 +05:30
parent 45ab4f486f
commit b4cd82945a

View file

@ -47,9 +47,6 @@ grub_script_cmd_shift (grub_command_t cmd __attribute__((unused)),
if (! scope)
return GRUB_ERR_NONE;
if (scope->argv.argc == 0)
return GRUB_ERR_NONE;
if (argc == 0)
n = 1;
@ -59,10 +56,13 @@ grub_script_cmd_shift (grub_command_t cmd __attribute__((unused)),
else
{
n = grub_strtoul (argv[0], &p, 10);
if (*p != '\0' || n > scope->argv.argc)
if (*p != '\0')
return GRUB_ERR_BAD_ARGUMENT;
}
if (n > scope->argv.argc)
return GRUB_ERR_BAD_ARGUMENT;
scope->argv.argc -= n;
scope->argv.args += n;
return GRUB_ERR_NONE;