bug-gnulib
[Top][All Lists]
Advanced

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

Re: strncasecmp in strings.h?


From: Bruno Haible
Subject: Re: strncasecmp in strings.h?
Date: Mon, 26 Nov 2007 21:05:25 +0100
User-agent: KMail/1.9.1

Karl Berry wrote:
> The spec at 
> http://www.opengroup.org/onlinepubs/009695399/functions/strcasecmp.html
> says the same.
> 
> The strcase gnulib module only mentions string.h, though, and we don't
> seem to do anything with strings.h anywhere.

Yes, gnulib declares these functions in <string.h> since 2007-01-26.
It was probably an oversight. Care to provide a patch that moves that out
to a substitute for <strings.h>? (The substitute does not need to be complete.
We don't care about the functions that are marked 'LEGACY' in POSIX.)

> I don't know the best thing to do.  For my purposes, I guess I can
> switch to c-strcase (or mbs*), but it seems like a bug somewhere ...

Yes, a look at doc/functions/strncasecmp.texi tells you that this function
is hardly useful since it does not work reasonably in multibyte-locales,
which are the majority of locales nowadays. If you need a locale-dependent
case comparison, use the mbs* functions; if you need a locale-independent
case comparison that considers only ASCII upper/lower letters, use the c-str*
functions.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]