X-Git-Url: https://git.xinqibao.xyz/dmenu.git/blobdiff_plain/724fe3cf7fc456db96bf10c2caeb7c307e529d73..6674bac1d3d0e1180fc4f9ea114f574eeb20f263:/dmenu.c diff --git a/dmenu.c b/dmenu.c index 3bb9351..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) + j = appenditem(i, j); + 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; }