From: Vladimir 'phcoder' Serbinenko Date: Wed, 2 May 2012 07:56:56 +0000 (+0200) Subject: * util/getroot.c (find_root_devices_from_poolname): Handle spaces in the X-Git-Tag: 2.00~282 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bcb288ed17ef2e3b053fea689da3e41da66edc42;p=thirdparty%2Fgrub.git * util/getroot.c (find_root_devices_from_poolname): Handle spaces in the name. --- diff --git a/ChangeLog b/ChangeLog index b56c00b40..cf926d708 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-05-02 Vladimir Serbinenko + + * util/getroot.c (find_root_devices_from_poolname): Handle spaces in the + name. + 2012-05-01 Vladimir Serbinenko * grub-core/net/ip.c (handle_dgram): Fix undeclared variable. diff --git a/util/getroot.c b/util/getroot.c index 2d62d63bf..3955f0037 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -380,8 +380,18 @@ find_root_devices_from_poolname (char *poolname) st++; break; case 1: - if (!strcmp (name, poolname)) - st++; + { + char *ptr = line; + while (1) + { + if (strncmp (ptr, poolname, strlen (poolname)) == 0 + && grub_isspace(ptr[strlen (poolname)])) + st++; + if (!grub_isspace (*ptr)) + break; + ptr++; + } + } break; case 2: if (strcmp (name, "mirror") && !sscanf (name, "mirror-%u", &dummy)