X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=dmenu.c;h=b28a5486d42310ffd66c93f8b5d57c3eb1d8c424;hb=3439470a47c935529b0fd692898e36d623e2a4b0;hp=a4fca09c9bd8edbd3ab8aae524885ed865381f7a;hpb=6514b07ad24e9066252c418cdec1d6ccae570cf6;p=dmenu.git diff --git a/dmenu.c b/dmenu.c index a4fca09..b28a548 100644 --- a/dmenu.c +++ b/dmenu.c @@ -507,20 +507,16 @@ match(char *pattern) { nitem = 0; for(i = allitems; i; i=i->next) i->matched = False; - for(i = allitems; i; i = i->next) if(!i->matched && !strncasecmp(pattern, i->text, plen)) j = appenditem(i, j); - - for (i = allitems; i; i = i->next) + for(i = allitems; i; i = i->next) if(!i->matched && strcasestr(i->text, pattern)) j = appenditem(i, j); - if(idomatch) - for (i = allitems; i; i = i->next) + for(i = allitems; i; i = i->next) if(!i->matched && strcaseido(i->text, pattern)) j = appenditem(i, j); - curr = prev = next = sel = item; calcoffsets(); } @@ -628,7 +624,7 @@ setup(Bool bottom) { int strcaseido(const char *text, const char *pattern) { for(; *text && *pattern; text++) - if (tolower(*text) == tolower(*pattern)) + if(tolower((int)*text) == tolower((int)*pattern)) pattern++; return !*pattern; }