* grub-core/commands/search_wrap.c (grub_cmd_search): Handle old

--fs-uuid --set UUID syntax.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-04-19 11:32:59 +02:00
parent 59e2651a06
commit 9c815e0120
2 changed files with 19 additions and 6 deletions

View file

@ -1,3 +1,8 @@
2012-04-18 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/commands/search_wrap.c (grub_cmd_search): Handle old
--fs-uuid --set UUID syntax.
2012-04-18 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_write): Fix message

View file

@ -86,6 +86,7 @@ grub_cmd_search (grub_extcmd_context_t ctxt, int argc, char **args)
{
struct grub_arg_list *state = ctxt->state;
const char *var = 0;
const char *id = 0;
int i = 0, j = 0, nhints = 0;
char **hints = NULL;
@ -163,20 +164,27 @@ grub_cmd_search (grub_extcmd_context_t ctxt, int argc, char **args)
if (grub_memcmp (args[j], "--hint-", sizeof ("--hint-") - 1) != 0)
break;
if (argc == j)
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected"));
if (state[SEARCH_SET].set)
var = state[SEARCH_SET].arg ? state[SEARCH_SET].arg : "root";
if (argc != j)
id = args[j];
else if (state[SEARCH_SET].set && state[SEARCH_SET].arg)
{
id = state[SEARCH_SET].arg;
var = "root";
}
else
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected"));
if (state[SEARCH_LABEL].set)
grub_search_label (args[j], var, state[SEARCH_NO_FLOPPY].set,
grub_search_label (id, var, state[SEARCH_NO_FLOPPY].set,
hints, nhints);
else if (state[SEARCH_FS_UUID].set)
grub_search_fs_uuid (args[j], var, state[SEARCH_NO_FLOPPY].set,
grub_search_fs_uuid (id, var, state[SEARCH_NO_FLOPPY].set,
hints, nhints);
else if (state[SEARCH_FILE].set)
grub_search_fs_file (args[j], var, state[SEARCH_NO_FLOPPY].set,
grub_search_fs_file (id, var, state[SEARCH_NO_FLOPPY].set,
hints, nhints);
else
return grub_error (GRUB_ERR_INVALID_COMMAND, "unspecified search type");