diff options
-rw-r--r-- | dmenu.c | 14 |
1 files changed, 3 insertions, 11 deletions
@@ -76,7 +76,6 @@ int ret = 0; | |||
76 | unsigned int cmdw = 0; | 76 | unsigned int cmdw = 0; |
77 | unsigned int mw, mh; | 77 | unsigned int mw, mh; |
78 | unsigned int promptw = 0; | 78 | unsigned int promptw = 0; |
79 | unsigned int nitem = 0; | ||
80 | unsigned int numlockmask = 0; | 79 | unsigned int numlockmask = 0; |
81 | Bool running = True; | 80 | Bool running = True; |
82 | Display *dpy; | 81 | Display *dpy; |
@@ -524,20 +523,13 @@ match(char *pattern) { | |||
524 | return; | 523 | return; |
525 | plen = strlen(pattern); | 524 | plen = strlen(pattern); |
526 | item = lexact = lprefix = lsubstr = itemend = exactend = prefixend = substrend = NULL; | 525 | item = lexact = lprefix = lsubstr = itemend = exactend = prefixend = substrend = NULL; |
527 | nitem = 0; | ||
528 | for(i = allitems; i; i = i->next) | 526 | for(i = allitems; i; i = i->next) |
529 | if(!fstrncmp(pattern, i->text, plen + 1)) { | 527 | if(!fstrncmp(pattern, i->text, plen + 1)) |
530 | appenditem(i, &lexact, &exactend); | 528 | appenditem(i, &lexact, &exactend); |
531 | nitem++; | 529 | else if(!fstrncmp(pattern, i->text, plen)) |
532 | } | ||
533 | else if(!fstrncmp(pattern, i->text, plen)) { | ||
534 | appenditem(i, &lprefix, &prefixend); | 530 | appenditem(i, &lprefix, &prefixend); |
535 | nitem++; | 531 | else if(fstrstr(i->text, pattern)) |
536 | } | ||
537 | else if(fstrstr(i->text, pattern)) { | ||
538 | appenditem(i, &lsubstr, &substrend); | 532 | appenditem(i, &lsubstr, &substrend); |
539 | nitem++; | ||
540 | } | ||
541 | if(lexact) { | 533 | if(lexact) { |
542 | item = lexact; | 534 | item = lexact; |
543 | itemend = exactend; | 535 | itemend = exactend; |