summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/menu.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2020-10-30 12:00:02 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2020-10-30 12:00:02 +0000
commitf3b668b60b24dcb4d9a12a01b521efdefba778dc (patch)
tree46cbe9c887d9997d939957d36bfcc847f4ed7c38 /usr.bin/tmux/menu.c
parent363280571c3bccf29e1f02ba5d9884df08010d95 (diff)
Do not allow disabled items to be selected.
Diffstat (limited to 'usr.bin/tmux/menu.c')
-rw-r--r--usr.bin/tmux/menu.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/tmux/menu.c b/usr.bin/tmux/menu.c
index 2d685fc16be..abd0496baca 100644
--- a/usr.bin/tmux/menu.c
+++ b/usr.bin/tmux/menu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: menu.c,v 1.32 2020/10/30 08:55:56 nicm Exp $ */
+/* $OpenBSD: menu.c,v 1.33 2020/10/30 12:00:01 nicm Exp $ */
/*
* Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -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;