From 832a7de8e6d33dd9a4c1f278a5989d30df24e16b Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Sun, 5 Feb 2023 21:26:49 +0000 Subject: Do not allow multiple line separators in a row. --- usr.bin/tmux/menu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.bin/tmux/menu.c b/usr.bin/tmux/menu.c index 52387036430..e1efa60e72d 100644 --- a/usr.bin/tmux/menu.c +++ b/usr.bin/tmux/menu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: menu.c,v 1.48 2023/01/20 21:36:00 nicm Exp $ */ +/* $OpenBSD: menu.c,v 1.49 2023/02/05 21:26:48 nicm Exp $ */ /* * Copyright (c) 2019 Nicholas Marriott @@ -64,6 +64,8 @@ menu_add_item(struct menu *menu, const struct menu_item *item, line = (item == NULL || item->name == NULL || *item->name == '\0'); if (line && menu->count == 0) return; + if (line && menu->items[menu->count - 1].name == NULL) + return; menu->items = xreallocarray(menu->items, menu->count + 1, sizeof *menu->items); -- cgit v1.2.3