]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/kern/emu/hostdisk.c
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 6 Nov 2010 23:10:49 +0000 (00:10 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 6 Nov 2010 23:10:49 +0000 (00:10 +0100)
(convert_system_partition_to_system_disk): Handle devices like "sdaa1".

ChangeLog
grub-core/kern/emu/hostdisk.c

index e7ffe6403e4693705ce3023ce79f4f23a9b2e37d..9faa0121d9f8d4c763d2017ed12e3ba8c28a51ef 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-11-07  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/kern/emu/hostdisk.c
+       (convert_system_partition_to_system_disk): Handle devices like "sdaa1".
+
 2010-11-06  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * include/grub/emu/misc.h: Don't include grub/util/libzfs.h.
index 08f60ee663449898d2f85a20ee5929b998079105..12dbe7469ba8c83de913b1fd5cf61b349b350399 100644 (file)
@@ -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;
        }