Branch
Hash :
557f0e49
Author :
Date :
2025-02-16T18:22:31
strncasecmp: Work around Solaris, Cygwin bug. * lib/strings.in.h (strncasecmp): Consider REPLACE_STRNCASECMP. Use the usual idioms. * m4/strings_h.m4 (gl_STRINGS_H_DEFAULTS): Initialize HAVE_STRNCASECMP, REPLACE_STRNCASECMP. * m4/strncasecmp.m4 (gl_FUNC_STRNCASECMP): Invoke gl_STRNCASECMP_WORKS. Set REPLACE_STRNCASECMP. Assume that HAVE_STRNCASECMP is initialized. * modules/strncasecmp (Files): Add m4/strcasecmp.m4. (configure.ac): Consider REPLACE_STRNCASECMP. * modules/strings-h (Makefile.am): Substitute HAVE_STRNCASECMP, REPLACE_STRNCASECMP. * doc/posix-functions/strncasecmp.texi: Mention the Solaris, Cygwin bug.
@node strncasecmp
@subsection @code{strncasecmp}
@findex strncasecmp
POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9799919799/functions/strncasecmp.html}
Gnulib module: strncasecmp
@mindex strncasecmp
Portability problems fixed by Gnulib:
@itemize
@item
This function is missing on some platforms:
MSVC 14.
@item
This function uses the case mappings of a wrong locale on some platforms:
Solaris 11.4,
@c https://sourceware.org/pipermail/cygwin/2025-February/257347.html
Cygwin 3.5.6.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
This function cannot work correctly on character strings in multibyte locales.
@mindex mbsncasecmp
@mindex mbspcasecmp
Gnulib provides alternative functions @code{mbsncasecmp} and @code{mbspcasecmp}
that do a case insensitive comparison of character strings and that work in all
locales.
@end itemize