Re: g_strncasecmp in glib



On Thu, 5 Nov 1998, Aaron Digulla wrote:

> Quoting Phil Schwan (pschwan@cmu.edu):
> 
> > Does anyone mind if I commit this patch?  Is there some reason that
> > 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().
> 
> >[...]
> > +	 /* 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" ?

nope, because islower() maybe broken, we are using isupper().

---
ciaoTJ



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