aboutsummaryrefslogtreecommitdiffstats
path: root/disk-utils/fdisk-menu.c
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2020-03-24 12:00:28 +0100
committerKarel Zak <kzak@redhat.com>2020-03-24 12:00:28 +0100
commit53a808562d5e19ae91fd37bbe49336472fb3f8ca (patch)
treee385031fcdfde12d5da69a35346ff106175ecc5c /disk-utils/fdisk-menu.c
parentf2229320a9f79a414464958c4fb73b83aa20213e (diff)
downloadutil-linux-53a808562d5e19ae91fd37bbe49336472fb3f8ca.tar.gz
fdisk: make sure label defined for some menu entries
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils/fdisk-menu.c')
-rw-r--r--disk-utils/fdisk-menu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/disk-utils/fdisk-menu.c b/disk-utils/fdisk-menu.c
index 71355f6848..51ae7b5e6e 100644
--- a/disk-utils/fdisk-menu.c
+++ b/disk-utils/fdisk-menu.c
@@ -279,7 +279,7 @@ static const struct menu_entry *next_menu_entry(
/* no more entries */
if (e->title == NULL ||
/* menu wanted for specified labels only */
- (m->label && lb && !(m->label & type)) ||
+ (m->label && (!lb || !(m->label & type))) ||
/* unwanted for nested PT */
(m->nonested && parent) ||
/* menu excluded for specified labels */
@@ -296,7 +296,7 @@ static const struct menu_entry *next_menu_entry(
/* excluded for the current label */
if ((e->exclude && lb && e->exclude & type) ||
/* entry wanted for specified labels only */
- (e->label && lb && !(e->label & type)) ||
+ (e->label && (!lb || !(e->label & type))) ||
/* exclude non-expert entries in expect mode */
(e->expert == 0 && fdisk_is_details(cxt)) ||
/* nested only */