[PATCH] fix incorrect ordering of match results

From: Davide \ <davide.delzompo_AT_gmail.com>
Date: Fri, 14 Aug 2015 16:53:37 +0200

look for exact matches comparing the user input against the item text
---
 dmenu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dmenu.c b/dmenu.c
index f0bc176..c3cb467 100644
--- a/dmenu.c
+++ b/dmenu.c
_AT_@ -485,7 +485,7 @@ match(void) {
 		if(i != tokc) /* not all tokens match */
 			continue;
 		/* exact matches go first, then prefixes, then substrings */
-		if(!tokc || !fstrncmp(tokv[0], item->text, len+1))
+		if(!tokc || !fstrncmp(text, item->text, strlen(text) + 1))
 			appenditem(item, &matches, &matchend);
 		else if(!fstrncmp(tokv[0], item->text, len))
 			appenditem(item, &lprefix, &prefixend);
-- 
2.5.0
--2oS5YaxWCcQjTEyO--
Received on Mon Sep 17 2001 - 00:00:00 CEST

This archive was generated by hypermail 2.3.0 : Fri Aug 14 2015 - 19:00:11 CEST