diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-05-19 13:01:33 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-05-19 18:51:30 +0200 |
| commit | 68eda885226f45b436bedf03447dd2be6c44d9a5 (patch) | |
| tree | 28a5900e921fce3c7de63d08bc5858082f0df378 | |
| parent | b28f3de3520282c35e41813a0177887dcd736c6c (diff) | |
| download | vis-68eda885226f45b436bedf03447dd2be6c44d9a5.tar.gz vis-68eda885226f45b436bedf03447dd2be6c44d9a5.tar.xz | |
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.
| -rw-r--r-- | vis-menu.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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])) |
