dmenu

dynamic menu
git clone git://git.suckless.org/dmenu
Log | Files | Refs | README | LICENSE

commit 5453bb65d98b466ea38494a867358fc9eed2250f
parent 7175c4880bac3d2a2d4a6262b59193f0a38e2fdb
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Sun, 13 Sep 2026 20:31:37 +0200

fix crash with long prompt and pressing the end key in horizontal mode

Reproducable with:

printf 'a\nb\n' | ./dmenu -p "$(printf 'x%.0s' $(seq 1 400))"

and then pressing the end key.

Reported by: jb19357 <jb19357@protonmail.com>
Who used Claude to write a report.

Diffstat:
Mdmenu.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dmenu.c b/dmenu.c @@ -171,7 +171,7 @@ drawmenu(void) /* draw vertical list */ for (item = curr; item != next; item = item->right) drawitem(item, x, y += bh, mw - x); - } else if (matches) { + } else if (matches && curr) { /* draw horizontal list */ x += inputw; w = TEXTW("<");