* grub-core/commands/parttool.c (grub_cmd_parttool): Move show_help out
of parent function.
This commit is contained in:
parent
6c69e691ca
commit
5aec2afe2f
2 changed files with 51 additions and 44 deletions
|
@ -1,3 +1,8 @@
|
|||
2013-02-28 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/commands/parttool.c (grub_cmd_parttool): Move show_help out
|
||||
of parent function.
|
||||
|
||||
2013-02-28 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* util/grub-fstest.c: Remove nested functions.
|
||||
|
|
|
@ -95,19 +95,11 @@ grub_parttool_unregister (int handle)
|
|||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)),
|
||||
int argc, char **args)
|
||||
show_help (grub_device_t dev)
|
||||
{
|
||||
grub_device_t dev;
|
||||
struct grub_parttool *cur, *ptool;
|
||||
int *parsed;
|
||||
int i, j;
|
||||
grub_err_t err = GRUB_ERR_NONE;
|
||||
|
||||
auto grub_err_t show_help (void);
|
||||
grub_err_t show_help (void)
|
||||
{
|
||||
int found = 0;
|
||||
struct grub_parttool *cur;
|
||||
|
||||
for (cur = parts; cur; cur = cur->next)
|
||||
if (grub_strcmp (dev->disk->partition->partmap->name, cur->name) == 0)
|
||||
{
|
||||
|
@ -144,7 +136,17 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)),
|
|||
grub_printf_ (N_("Sorry no parttool is available for %s\n"),
|
||||
dev->disk->partition->partmap->name);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)),
|
||||
int argc, char **args)
|
||||
{
|
||||
grub_device_t dev;
|
||||
struct grub_parttool *cur, *ptool;
|
||||
int *parsed;
|
||||
int i, j;
|
||||
grub_err_t err = GRUB_ERR_NONE;
|
||||
|
||||
if (argc < 1)
|
||||
{
|
||||
|
@ -241,11 +243,11 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)),
|
|||
}
|
||||
|
||||
if (argc == 1)
|
||||
return show_help ();
|
||||
return show_help (dev);
|
||||
|
||||
for (i = 1; i < argc; i++)
|
||||
if (grub_strcmp (args[i], "help") == 0)
|
||||
return show_help ();
|
||||
return show_help (dev);
|
||||
|
||||
parsed = (int *) grub_zalloc (argc * sizeof (int));
|
||||
|
||||
|
|
Loading…
Reference in a new issue