summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2020-10-30 12:00:01 +0000
committernicm <nicm@openbsd.org>2020-10-30 12:00:01 +0000
commite579339db21c42d018436d198ac26e48e89e7f66 (patch)
tree38e3d7ad476c7fdba467714a9b1116d6a85d6023
parentLimit range of repeat to avoid silly high numbers causing delays, from (diff)
downloadwireguard-openbsd-e579339db21c42d018436d198ac26e48e89e7f66.tar.xz
wireguard-openbsd-e579339db21c42d018436d198ac26e48e89e7f66.zip
Do not allow disabled items to be selected.
-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;