From b7db5d47d96b7471ab1508920555a5a121896817 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 31 May 2008 21:08:04 +0000 Subject: [PATCH] 2008-05-31 Robert Millan * commands/search.c (search_label, search_fs_uuid, search_file): Do not print device names when we were asked to set a variable. --- ChangeLog | 5 +++++ commands/search.c | 27 ++++++++++++++++++--------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 889efd9c1..5590227d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-05-31 Robert Millan + + * commands/search.c (search_label, search_fs_uuid, search_file): Do + not print device names when we were asked to set a variable. + 2008-05-31 Robert Millan * term/ieee1275/ofconsole.c (grub_ofconsole_setcursor): Implement diff --git a/commands/search.c b/commands/search.c index a4bbd2c87..57b03976b 100644 --- a/commands/search.c +++ b/commands/search.c @@ -63,9 +63,12 @@ search_label (const char *key, const char *var) if (grub_strcmp (label, key) == 0) { /* Found! */ - grub_printf (" %s", name); - if (count++ == 0 && var) - grub_env_set (var, name); + if (var) + { + grub_printf (" %s", name); + if (count++ == 0) + grub_env_set (var, name); + } } grub_free (label); @@ -111,9 +114,12 @@ search_fs_uuid (const char *key, const char *var) if (grub_strcmp (uuid, key) == 0) { /* Found! */ - grub_printf (" %s", name); - if (count++ == 0 && var) - grub_env_set (var, name); + if (var) + { + grub_printf (" %s", name); + if (count++ == 0) + grub_env_set (var, name); + } } grub_free (uuid); @@ -158,9 +164,12 @@ search_file (const char *key, const char *var) if (file) { /* Found! */ - grub_printf (" %s", name); - if (count++ == 0 && var) - grub_env_set (var, name); + if (var) + { + grub_printf (" %s", name); + if (count++ == 0) + grub_env_set (var, name); + } grub_file_close (file); }