From: Andrey Borzenkov <arvidjaar@gmail.com>
To: grub-devel@gnu.org
Subject: [PATCH] trivial fix for config_file without directory part
Date: Sat, 7 Dec 2013 23:51:54 +0400 [thread overview]
Message-ID: <1386445914-18069-1-git-send-email-arvidjaar@gmail.com> (raw)
It is legal to use "configfile <top level filename>" where filename does
not contain directory part. In this case config_directory is set to filename.
Set it to empty string so $config_directory/file works as expected.
May be it makes sense to generate full pathname (including device part)
so that interpretation of $config_directory does not depend on possible
change of $root.
---
grub-core/normal/main.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c
index 991a595..16f22fb 100644
--- a/grub-core/normal/main.c
+++ b/grub-core/normal/main.c
@@ -196,6 +196,8 @@ read_config_file (const char *config)
ptr = grub_strrchr (config_dir, '/');
if (ptr)
*ptr = 0;
+ else if (config_dir)
+ *config_dir = 0;
grub_env_set ("config_directory", config_dir);
grub_free (config_dir);
--
tg: (bb05e31..) u/config_file_without_dir (depends on: master)
next reply other threads:[~2013-12-07 19:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-07 19:51 Andrey Borzenkov [this message]
2013-12-07 19:57 ` [PATCH] trivial fix for config_file without directory part Vladimir 'φ-coder/phcoder' Serbinenko
2013-12-07 20:06 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-12-08 21:05 ` [PATCH] always define config_directory and config_file as full pathname Andrey Borzenkov
2013-12-09 23:27 ` Vladimir 'φ-coder/phcoder' Serbinenko
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=1386445914-18069-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).