From 68eda885226f45b436bedf03447dd2be6c44d9a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Thu, 19 May 2016 13:01:33 +0200 Subject: vis-menu: fix matching order, exact matches should come first This reverts 09d0a36e0370f7ca9bdb171bf93c5ac3131c5a92 from the dmenu repository, although dmenu itself seems to work correctly. $ printf "foobar\nfoo\n" | ./vis-menu Typing foo should select foo not foobar. --- vis-menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vis-menu.c b/vis-menu.c index 2b9bad7..2fd4903 100644 --- a/vis-menu.c +++ b/vis-menu.c @@ -244,7 +244,7 @@ match(void) len = tokc ? strlen(tokv[0]) : 0; matches = lprefix = lsubstr = matchend = prefixend = substrend = NULL; - textsize = strlen(text); + textsize = strlen(text) + 1; for (item = items; item && item->text; item++) { for (i = 0; i < tokc; i++) if (!fstrstr(item->text, tokv[i])) -- cgit v1.2.3