]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
cfdisk: don't offer BSD
authorKarel Zak <kzak@redhat.com>
Fri, 20 Jun 2014 10:07:30 +0000 (12:07 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 20 Jun 2014 10:07:30 +0000 (12:07 +0200)
BSD is nested within DOS partition, so for disk without any partition
table it does not make any sense to offer BSD label.

Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/cfdisk.c

index bf49cf25772148f44b56c94a1ab286b804047fbb..d350dc842f2b807b50e62620d59f1fe270111f8d 100644 (file)
@@ -1529,10 +1529,10 @@ static int ui_create_label(struct cfdisk *cf)
        nitems = fdisk_context_get_nlabels(cf->cxt);
        cm = xcalloc(nitems + 1, sizeof(struct cfdisk_menuitem));
 
-       for (i = 0; i < nitems; i++) {
-               if (fdisk_context_next_label(cf->cxt, &lb))
-                       break;
-               cm[i].name = lb->name;
+       while (fdisk_context_next_label(cf->cxt, &lb) == 0) {
+               if (fdisk_label_is_disabled(lb) || strcmp(lb->name, "bsd") == 0)
+                       continue;
+               cm[i++].name = lb->name;
        }
 
        erase();