From: arg@mmvi Date: Tue, 26 Sep 2006 06:47:10 +0000 (+0200) Subject: uriel didn't understood dmenu code, he broke nearly everything X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;h=e0fe9f2fcac32f04f7fda5236f48d1a705cbdcce;p=dmenu.git uriel didn't understood dmenu code, he broke nearly everything --- 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