summaryrefslogtreecommitdiffstats
path: root/menu.c
diff options
context:
space:
mode:
authornicm <nicm>2020-10-30 12:00:01 +0000
committernicm <nicm>2020-10-30 12:00:01 +0000
commit9726c4454e29cb5b9c6681abfb5c99972a9bd574 (patch)
treeb57c7d583943539fa5598c2d1bf48034727cabda /menu.c
parent8e1d28453d23d6283abe1bb709a4fe06139d2750 (diff)
Do not allow disabled items to be selected.
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/menu.c b/menu.c
index 3bd56ab1..48c9ed2f 100644
--- a/menu.c
+++ b/menu.c
@@ -315,10 +315,11 @@ chosen:
if (md->choice == -1)
return (1);
item = &menu->items[md->choice];
- if ((md->flags & MENU_STAYOPEN) && item->name == NULL)
- return (0);
- if (item->name == NULL || *item->name == '-')
+ if (item->name == NULL || *item->name == '-') {
+ if (md->flags & MENU_STAYOPEN)
+ return (0);
return (1);
+ }
if (md->cb != NULL) {
md->cb(md->menu, md->choice, item->key, md->data);
md->cb = NULL;