From: Karel Zak Date: Fri, 20 Jun 2014 10:07:30 +0000 (+0200) Subject: cfdisk: don't offer BSD X-Git-Tag: v2.25-rc2~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd626abdbeac4ce15dbe57c8d92702ac1a64d456;p=thirdparty%2Futil-linux.git cfdisk: don't offer BSD 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 --- diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c index bf49cf2577..d350dc842f 100644 --- a/disk-utils/cfdisk.c +++ b/disk-utils/cfdisk.c @@ -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();