diff options
author | Andrew Gregory <andrew.gregory.8@gmail.com> | 2016-12-07 09:45:01 -0500 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2016-12-11 12:33:16 +0100 |
commit | 5cd66e2c6ca6a82e59927d495498fa6e478594d6 (patch) | |
tree | 0c400d341d724b7b3b89c37b74dd4ec3dd0a71f7 | |
parent | e90b88e12a88d6214c00d5ee58ceb69446aa5ac4 (diff) |
Revert "fix input text matching"
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.
-rw-r--r-- | dmenu.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -228,7 +228,7 @@ match(void) | |||
228 | len = tokc ? strlen(tokv[0]) : 0; | 228 | len = tokc ? strlen(tokv[0]) : 0; |
229 | 229 | ||
230 | matches = lprefix = lsubstr = matchend = prefixend = substrend = NULL; | 230 | matches = lprefix = lsubstr = matchend = prefixend = substrend = NULL; |
231 | textsize = strlen(text); | 231 | textsize = strlen(text) + 1; |
232 | for (item = items; item && item->text; item++) { | 232 | for (item = items; item && item->text; item++) { |
233 | for (i = 0; i < tokc; i++) | 233 | for (i = 0; i < tokc; i++) |
234 | if (!fstrstr(item->text, tokv[i])) | 234 | if (!fstrstr(item->text, tokv[i])) |