From: Colin Watson Date: Fri, 4 Feb 2011 13:33:16 +0000 (+0000) Subject: Handle empty dir passed to grub_find_root_device_from_mountinfo; fixes grub-mkrelpath... X-Git-Tag: 1.99~64^2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c2c4ff2f533cf37c2025655497f3dfc8cfd5eef;p=thirdparty%2Fgrub.git Handle empty dir passed to grub_find_root_device_from_mountinfo; fixes grub-mkrelpath on btrfs subvolumes. --- diff --git a/grub-core/kern/emu/getroot.c b/grub-core/kern/emu/getroot.c index 92ff971e5..c1ed35b2d 100644 --- a/grub-core/kern/emu/getroot.c +++ b/grub-core/kern/emu/getroot.c @@ -111,6 +111,8 @@ grub_find_root_device_from_mountinfo (const char *dir, char **relroot) size_t len = 0; char *ret = NULL; + if (! *dir) + dir = "/"; if (relroot) *relroot = NULL;