From: Vladimir 'phcoder' Serbinenko Date: Sat, 6 Nov 2010 23:10:49 +0000 (+0100) Subject: * grub-core/kern/emu/hostdisk.c X-Git-Tag: 1.99~346 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=80c6d25eef6eb48a2c349b19ddb1b33d70333ebe;p=thirdparty%2Fgrub.git * grub-core/kern/emu/hostdisk.c (convert_system_partition_to_system_disk): Handle devices like "sdaa1". --- diff --git a/ChangeLog b/ChangeLog index e7ffe6403..9faa0121d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-11-07 Vladimir Serbinenko + + * grub-core/kern/emu/hostdisk.c + (convert_system_partition_to_system_disk): Handle devices like "sdaa1". + 2010-11-06 Vladimir Serbinenko * include/grub/emu/misc.h: Don't include grub/util/libzfs.h. diff --git a/grub-core/kern/emu/hostdisk.c b/grub-core/kern/emu/hostdisk.c index 08f60ee66..12dbe7469 100644 --- a/grub-core/kern/emu/hostdisk.c +++ b/grub-core/kern/emu/hostdisk.c @@ -1152,16 +1152,22 @@ convert_system_partition_to_system_disk (const char *os_dev, struct stat *st) || strncmp ("sd", p, 2) == 0) && p[2] >= 'a' && p[2] <= 'z') { - /* /dev/[hsv]d[a-z][0-9]* */ - p[3] = '\0'; + char *pp = p + 2; + while (*pp >= 'a' && *pp <= 'z') + pp++; + /* /dev/[hsv]d[a-z]+[0-9]* */ + *pp = '\0'; return path; } /* If this is a Xen virtual block device. */ if ((strncmp ("xvd", p, 3) == 0) && p[3] >= 'a' && p[3] <= 'z') { - /* /dev/xvd[a-z][0-9]* */ - p[4] = '\0'; + char *pp = p + 3; + while (*pp >= 'a' && *pp <= 'z') + pp++; + /* /dev/xvd[a-z]+[0-9]* */ + *pp = '\0'; return path; }