From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VpNvN-00030H-RY for mharc-grub-devel@gnu.org; Sat, 07 Dec 2013 14:52:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VpNvB-0002kd-Jj for grub-devel@gnu.org; Sat, 07 Dec 2013 14:52:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VpNv2-0001hx-PU for grub-devel@gnu.org; Sat, 07 Dec 2013 14:52:13 -0500 Received: from mail-la0-x22e.google.com ([2a00:1450:4010:c03::22e]:37411) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VpNv2-0001hr-F9 for grub-devel@gnu.org; Sat, 07 Dec 2013 14:52:04 -0500 Received: by mail-la0-f46.google.com with SMTP id eh20so795294lab.33 for ; Sat, 07 Dec 2013 11:52:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=rRdpRAJOgWNC3c7byS6qiO3DXkcYCwHZEaBmky+Ksd0=; b=0L4Sd0lz6nK16RawRUsARcPaLW0VuDgheUgt8B1BJ2KoypVutzPsnVP1kSSlcjGur4 evtmHwVsPGIGyQ0xyjThvBCmlRe/o6BHR6KyYKixUeKhYKwS4Fnf9rywwKonpTVG86Gk 8OwmjxTxzCxB0OcT0WXRAyKbqlAHwzUKKb9nllZKdaIWPH5gSc85Ll+ebHlyUP12kVBe 4ByKvz8jKGRsbls1B+vldmeARwlLIAAT14h7BuFEGrbjYZVMIkzgIy1qUd+pNe/+xHzp YGY4n0Ghjooac1Q86LpAN+RpBuwCaX53YU0gT6UBUNCtGGeGAF+O/dd/h6xHdU+SdCmb 7hdA== X-Received: by 10.112.50.15 with SMTP id y15mr2416313lbn.57.1386445922755; Sat, 07 Dec 2013 11:52:02 -0800 (PST) Received: from localhost.localdomain (ppp91-76-134-134.pppoe.mtu-net.ru. [91.76.134.134]) by mx.google.com with ESMTPSA id mq10sm3038790lbb.12.2013.12.07.11.52.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Dec 2013 11:52:02 -0800 (PST) From: Andrey Borzenkov To: grub-devel@gnu.org Subject: [PATCH] trivial fix for config_file without directory part Date: Sat, 7 Dec 2013 23:51:54 +0400 Message-Id: <1386445914-18069-1-git-send-email-arvidjaar@gmail.com> X-Mailer: git-send-email 1.8.1.4 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::22e X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Dec 2013 19:52:24 -0000 It is legal to use "configfile " 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)