Skip to contentSkip to conversation

fix listing values of variables with read hook in set command

PATCH New Andrey Borzenkov 1 participant 1 message May 16, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix listing values of variables with read hook in set command

Variables with read hook may return valid value even before they are explicitly set. Use grub_env_get() to fetch values to ensure hooks are called.

---
 ChangeLog                | 5 +++++
 grub-core/kern/corecmd.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
ChangeLog +5 -0
index e2e38f3..e78c9f5 100644
@@ -1,3 +1,8 @@
+2013-05-16  Andrey Borzenkov <[email protected]>
+
+	* grub-core/kern/corecmd.c (grub_core_cmd_set): Use grub_env_get
+	to fetch values when listing.
+
 2013-05-15  Radosław Szymczyszyn  <[email protected]>
 
 	* grub-core/partmap/dfly.c: New partition map.
grub-core/kern/corecmd.c +1 -1
index e1bb483..54ad32a 100644
@@ -40,7 +40,7 @@ grub_core_cmd_set (struct grub_command *cmd __attribute__ ((unused)),
     {
       struct grub_env_var *env;
       FOR_SORTED_ENV (env)
-	grub_printf ("%s=%s\n", env->name, env->value);
+	grub_printf ("%s=%s\n", env->name, grub_env_get (env->name));
       return 0;
     }
 
Signature · 1 line
tg: (0a5312f..) u/list_env (depends on: master)