]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Fix an issue with new interface for device names
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 8 Sep 2010 19:02:51 +0000 (21:02 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 8 Sep 2010 19:02:51 +0000 (21:02 +0200)
grub-core/kern/partition.c

index a2f5dd722c081a4ae37749f74a0ac404ad6d6fdd..bd10774e8b323fa93b4a50d82b5de321d98235ed 100644 (file)
@@ -188,7 +188,13 @@ grub_partition_iterate (struct grub_disk *disk,
       if (p.start != 0)
        {
          const struct grub_partition_map *partmap;
+         const char *name;
+         char *newname;
          dsk->partition = &p;
+         name = dsk->name;
+         dsk->name = newname = grub_xasprintf ("%s,%s%d", dsk->name,
+                                               p.partmap->name,
+                                               p.number + 1);
          FOR_PARTITION_MAPS(partmap)
          {
            grub_err_t err;
@@ -198,6 +204,8 @@ grub_partition_iterate (struct grub_disk *disk,
            if (ret)
              break;
          }
+         grub_free (newname);
+         dsk->name = name;
        }
       dsk->partition = p.parent;
       return ret;