summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorarg@mmvi <unknown>2006-09-26 08:47:10 +0200
committerarg@mmvi <unknown>2006-09-26 08:47:10 +0200
commite0fe9f2fcac32f04f7fda5236f48d1a705cbdcce (patch)
treea0280f5ac347c43ab923f4b6cc8d493a580a20ad /main.c
parentc9465859a6eac7763d0b9049dca6bd34c163d8f6 (diff)
uriel didn't understood dmenu code, he broke nearly everything
Diffstat (limited to 'main.c')
-rw-r--r--main.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/main.c b/main.c
index 77a61b9..170a3e0 100644
--- a/main.c
+++ b/main.c
@@ -120,8 +120,19 @@ match(char *pattern) {
nitem = 0;
for(i = allitems; i; i=i->next)
- if(plen ? !strncmp(pattern, i->text, plen) :
- strncmp(pattern, i->text, plen) && strstr(i->text, pattern)) {
+ if(!plen || !strncmp(pattern, i->text, plen)) {
+ if(!j)
+ item = i;
+ else
+ j->right = i;
+ i->left = j;
+ i->right = NULL;
+ j = i;
+ nitem++;
+ }
+ for(i = allitems; i; i=i->next)
+ if(plen && strncmp(pattern, i->text, plen)
+ && strstr(i->text, pattern)) {
if(!j)
item = i;
else