Re: g_strncasecmp in glib



On Nov 05, Aaron Digulla wrote:
> > Does anyone mind if I commit this patch?  Is there some reason that

Actually, Manish told me to go ahead with it, but it works, and it can
certainly be tweaked now that it's in...

> > I'm not aware of that there's not already a g_strncasecmp?
> >[...]
> > +#ifdef HAVE_STRNCASECMP
> > +  return strncasecmp (s1, s2, n);
> > +#else
> 
> Just a sidenote: I have seen strnicmp() instead of strncasecmp().

Hrm, ok.  Same argument patterns, I presume?

> >[...]
> > +	 /* According to A. Cox, some platforms have islower's that
> > +	  * don't work right on non-uppercase
> > +	  */
> > +	 c1 = isupper ((guchar)*s1) ? tolower ((guchar)*s1) : *s1;
> > +	 c2 = isupper ((guchar)*s2) ? tolower ((guchar)*s2) : *s2;
> 
> Huh ? This comment doesn't make much sense. Shouldn't that be
> "... have tolower's that" ?
> 
> Also, I would put that into #ifdef G_TOLOWER_IS_BROKEN.

Actually, I copied that bit verbatim from g_strcasecmp (and only half
read it).  I think you're right--it makes more sense if you
s/islower/tolower/ and should probably be changed in both cases.

As for doing the G_TOLOWER_IS_BROKEN stuff, I suppose that will
involve me writing an autoconf macro too, huh? :)

-Phil

------------------------------------------------------------------
"In film you will find four basic story lines. Man versus man, man
versus nature, nature versus nature, and dog versus vampire."
        - Steven Spielberg



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]