Re: [dwm] dmenu - simplification of cistrstr and kpress

From: Premysl Hruby <dfenze_AT_gmail.com>
Date: Thu, 26 Jun 2008 17:37:54 +0200

On (26/06/08 17:24), Sander van Dijk wrote:
> To: dynamic window manager <dwm_AT_suckless.org>
> From: Sander van Dijk <a.h.vandijk_AT_gmail.com>
> Subject: Re: [dwm] dmenu - simplification of cistrstr and kpress
> Reply-To: dynamic window manager <dwm_AT_suckless.org>
> List-Id: dynamic window manager <dwm.suckless.org>
>
> That would be better, but then it still wouldn't do the right thing:
>
> if (strcasecmp(s, sub) == 0)
>
> is only true when "s" is exactly the same (ignoring case, of course)
> as "sub", which would make
>
> cistrstr("blaat", "aa")
>
> NOT match, which is wrong.
>
> Gr. Sander.
>

Oh, true :)

there must be something like:

uint len;
...

len = strlen(sub);

and that if changed to:
if (strncasecmp(s, sub, len) == 0)

-Ph

-- 
Premysl "Anydot" Hruby, http://www.redrum.cz/
Received on Thu Jun 26 2008 - 17:38:11 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:51:37 UTC