]> git.armaanb.net Git - dmenu.git/commitdiff
Revert "fix input text matching"
authorAndrew Gregory <andrew.gregory.8@gmail.com>
Wed, 7 Dec 2016 14:45:01 +0000 (09:45 -0500)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Sun, 11 Dec 2016 11:33:16 +0000 (12:33 +0100)
This reverts commit 09d0a36e0370f7ca9bdb171bf93c5ac3131c5a92.

Using strncmp with the length of the user input turns it into a prefix
match rather than an exact match as it's supposed to be.

dmenu.c

diff --git a/dmenu.c b/dmenu.c
index 1cfefcd5543e495dfe5c55309ac9666189cf3fb0..d605ab494dbf8d5e6ed47041a66fbfb950d8cdfe 100644 (file)
--- a/dmenu.c
+++ b/dmenu.c
@@ -228,7 +228,7 @@ match(void)
        len = tokc ? strlen(tokv[0]) : 0;
 
        matches = lprefix = lsubstr = matchend = prefixend = substrend = NULL;
        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]))
        for (item = items; item && item->text; item++) {
                for (i = 0; i < tokc; i++)
                        if (!fstrstr(item->text, tokv[i]))