+2007-02-04 Bruno Haible <bruno@clisp.org>
+
+ Simplify handling of strncasecmp.
+ * lib/string_.h (strncasecmp): Remove test for GNULIB_STRCASE. Change
+ the conditional link warning.
+ * m4/string_h.m4 (gl_STRING_MODULE_INDICATOR_DEFAULTS): Don't
+ initialize GNULIB_STRCASE.
+ * modules/strcase (configure.ac): Don't invoke
+ gl_STRING_MODULE_INDICATOR.
+ * modules/string (string.h): Don't substitute GNULIB_STRCASE.
+
2007-02-04 Bruno Haible <bruno@clisp.org>
New module mbscasecmp, reduced goal of strcasecmp.
returning less than, equal to or greater than zero if S1 is
lexicographically less than, equal to or greater than S2.
Note: This function cannot work correctly in multibyte locales. */
-#if @GNULIB_STRCASE@
-# if ! @HAVE_DECL_STRNCASECMP@
-extern int strncasecmp (char const *__s1, char const *__s2, size_t __n);
-# endif
+#if ! @HAVE_DECL_STRNCASECMP@
+extern int strncasecmp (char const *s1, char const *s2, size_t n);
#endif
#if defined GNULIB_POSIXCHECK
+/* strncasecmp() does not work with multibyte strings:
+ POSIX says that it operates on "strings", and "string" in POSIX is defined
+ as a sequence of bytes, not of characters. */
# undef strncasecmp
# define strncasecmp(a,b) \
- (GL_LINK_WARNING ("strncasecmp cannot work correctly in multibyte locales - don't use it if you care about internationalization"), \
+ (GL_LINK_WARNING ("strncasecmp cannot work correctly on character strings in multibyte locales - don't use it if you care about internationalization; use c_strncasecmp (from gnulib module c-strcase) if you want a locale independent function"), \
strncasecmp (a, b))
#endif
GNULIB_MEMRCHR=0; AC_SUBST([GNULIB_MEMRCHR])
GNULIB_STPCPY=0; AC_SUBST([GNULIB_STPCPY])
GNULIB_STPNCPY=0; AC_SUBST([GNULIB_STPNCPY])
- GNULIB_STRCASE=0; AC_SUBST([GNULIB_STRCASE])
GNULIB_STRCHRNUL=0; AC_SUBST([GNULIB_STRCHRNUL])
GNULIB_STRDUP=0; AC_SUBST([GNULIB_STRDUP])
GNULIB_STRNDUP=0; AC_SUBST([GNULIB_STRNDUP])
configure.ac:
gl_STRCASE
-gl_STRING_MODULE_INDICATOR([strcase])
Makefile.am:
-e 's|@''GNULIB_MEMRCHR''@|$(GNULIB_MEMRCHR)|g' \
-e 's|@''GNULIB_STPCPY''@|$(GNULIB_STPCPY)|g' \
-e 's|@''GNULIB_STPNCPY''@|$(GNULIB_STPNCPY)|g' \
- -e 's|@''GNULIB_STRCASE''@|$(GNULIB_STRCASE)|g' \
-e 's|@''GNULIB_STRCHRNUL''@|$(GNULIB_STRCHRNUL)|g' \
-e 's|@''GNULIB_STRDUP''@|$(GNULIB_STRDUP)|g' \
-e 's|@''GNULIB_STRNDUP''@|$(GNULIB_STRNDUP)|g' \