grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Borzenkov <arvidjaar@gmail.com>
To: grub-devel@gnu.org
Subject: [PATCH] fix listing values of variables with read hook in set command
Date: Thu, 16 May 2013 20:43:37 +0400	[thread overview]
Message-ID: <1368722617-15690-1-git-send-email-arvidjaar@gmail.com> (raw)

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.

Signed-off-by: Andrey Borzenkov <arvidjaar@gmail.com>

---
 ChangeLog                | 5 +++++
 grub-core/kern/corecmd.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index e2e38f3..e78c9f5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-05-16  Andrey Borzenkov <arvidjaar@gmail.com>
+
+	* grub-core/kern/corecmd.c (grub_core_cmd_set): Use grub_env_get
+	to fetch values when listing.
+
 2013-05-15  Radosław Szymczyszyn  <lavrin@gmail.com>
 
 	* grub-core/partmap/dfly.c: New partition map.
diff --git a/grub-core/kern/corecmd.c b/grub-core/kern/corecmd.c
index e1bb483..54ad32a 100644
--- a/grub-core/kern/corecmd.c
+++ b/grub-core/kern/corecmd.c
@@ -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;
     }
 
-- 
tg: (0a5312f..) u/list_env (depends on: master)


                 reply	other threads:[~2013-05-16 16:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1368722617-15690-1-git-send-email-arvidjaar@gmail.com \
    --to=arvidjaar@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).