* modules/strcasecmp: New file.
* modules/strncasecmp: New file.
* modules/strcase: Merely depend on strcasecmp, strncasecmp.
* m4/strcasecmp.m4: New file, based on m4/strcase.m4.
* m4/strncasecmp.m4: New file, based on m4/strcase.m4.
* m4/strcase.m4: Remove file.
* lib/strings.in.h (strcasecmp, strncasecmp): Fix typo in warning
message.
* lib/strcasecmp.c: Improve comment.
* lib/strncasecmp.c: Likewise.
* doc/posix-functions/strcasecmp.texi: Mention module strcasecmp, not
module strcase.
* doc/posix-functions/strncasecmp.texi: Mention module strncasecmp, not
module strcase.
* doc/strings.texi (Comparison of string APIs): Reference modules
strcasecmp, strncasecmp.
* modules/argp (Depends-on): Add strcasecmp. Remove strcase.
* modules/strcasestr-simple (Depends-on): Add strncasecmp. Remove
strcase.
* modules/strptime (Depends-on): Likewise.
+2025-02-16 Bruno Haible <bruno@clisp.org>
+
+ strcasecmp, strncasecmp: New modules.
+ * modules/strcasecmp: New file.
+ * modules/strncasecmp: New file.
+ * modules/strcase: Merely depend on strcasecmp, strncasecmp.
+ * m4/strcasecmp.m4: New file, based on m4/strcase.m4.
+ * m4/strncasecmp.m4: New file, based on m4/strcase.m4.
+ * m4/strcase.m4: Remove file.
+ * lib/strings.in.h (strcasecmp, strncasecmp): Fix typo in warning
+ message.
+ * lib/strcasecmp.c: Improve comment.
+ * lib/strncasecmp.c: Likewise.
+ * doc/posix-functions/strcasecmp.texi: Mention module strcasecmp, not
+ module strcase.
+ * doc/posix-functions/strncasecmp.texi: Mention module strncasecmp, not
+ module strcase.
+ * doc/strings.texi (Comparison of string APIs): Reference modules
+ strcasecmp, strncasecmp.
+ * modules/argp (Depends-on): Add strcasecmp. Remove strcase.
+ * modules/strcasestr-simple (Depends-on): Add strncasecmp. Remove
+ strcase.
+ * modules/strptime (Depends-on): Likewise.
+
2025-02-16 Bruno Haible <bruno@clisp.org>
ctype-h: Make ctype.h self-contained again (regr. 2025-02-14).
POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9799919799/functions/strcasecmp.html}
-Gnulib module: strcase
-@mindex strcase
+Gnulib module: strcasecmp
+@mindex strcasecmp
Portability problems fixed by Gnulib:
@itemize
POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9799919799/functions/strncasecmp.html}
-Gnulib module: strcase
-@mindex strcase
+Gnulib module: strncasecmp
+@mindex strncasecmp
Portability problems fixed by Gnulib:
@itemize
@mindex mbs_startswith
@mindex stpcpy
@mindex stpncpy
-@mindex strcase
+@mindex strcasecmp
@mindex strcasestr
@mindex strcspn
@mindex strdup
@mindex string-desc
+@mindex strncasecmp
@mindex strncat
@mindex strndup
@mindex strnlen
-/* Case-insensitive string comparison function.
+/* Case-insensitive string comparison function for unibyte locales.
Copyright (C) 1998-1999, 2005-2007, 2009-2025 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
_GL_WARN_ON_USE (strcasecmp, "strcasecmp cannot work correctly on character "
"strings in multibyte locales - "
"use mbscasecmp if you care about "
- "internationalization, or use c_strcasecmp , "
- "gnulib module c-strcase) if you want a locale "
+ "internationalization, or use c_strcasecmp "
+ "(gnulib module c-strcase) if you want a locale "
"independent function");
# endif
#endif
_GL_WARN_ON_USE (strncasecmp, "strncasecmp cannot work correctly on character "
"strings in multibyte locales - "
"use mbsncasecmp or mbspcasecmp if you care about "
- "internationalization, or use c_strncasecmp , "
- "gnulib module c-strcase) if you want a locale "
+ "internationalization, or use c_strncasecmp "
+ "(gnulib module c-strcase) if you want a locale "
"independent function");
# endif
#endif
-/* strncasecmp.c -- case insensitive string comparator
+/* Case-insensitive string comparison function for unibyte locales.
Copyright (C) 1998-1999, 2005-2007, 2009-2025 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
+++ /dev/null
-# strcase.m4
-# serial 12
-dnl Copyright (C) 2002, 2005-2025 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-dnl This file is offered as-is, without any warranty.
-
-AC_DEFUN([gl_STRCASE],
-[
- gl_FUNC_STRCASECMP
- gl_FUNC_STRNCASECMP
-])
-
-AC_DEFUN([gl_FUNC_STRCASECMP],
-[
- AC_REQUIRE([gl_STRINGS_H_DEFAULTS])
- AC_CHECK_FUNCS([strcasecmp])
- if test $ac_cv_func_strcasecmp = no; then
- HAVE_STRCASECMP=0
- fi
-])
-
-AC_DEFUN([gl_FUNC_STRNCASECMP],
-[
- AC_REQUIRE([gl_STRINGS_H_DEFAULTS])
- AC_CHECK_FUNCS([strncasecmp])
- if test $ac_cv_func_strncasecmp = yes; then
- HAVE_STRNCASECMP=1
- else
- HAVE_STRNCASECMP=0
- fi
- AC_CHECK_DECLS([strncasecmp])
- if test $ac_cv_have_decl_strncasecmp = no; then
- HAVE_DECL_STRNCASECMP=0
- fi
-])
-
-# Prerequisites of lib/strcasecmp.c.
-AC_DEFUN([gl_PREREQ_STRCASECMP], [
- :
-])
-
-# Prerequisites of lib/strncasecmp.c.
-AC_DEFUN([gl_PREREQ_STRNCASECMP], [
- :
-])
--- /dev/null
+# strcasecmp.m4
+# serial 1
+dnl Copyright (C) 2002-2025 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl This file is offered as-is, without any warranty.
+
+AC_DEFUN([gl_FUNC_STRCASECMP],
+[
+ AC_REQUIRE([gl_STRINGS_H_DEFAULTS])
+ AC_CHECK_FUNCS([strcasecmp])
+ if test $ac_cv_func_strcasecmp = no; then
+ HAVE_STRCASECMP=0
+ fi
+])
+
+# Prerequisites of lib/strcasecmp.c.
+AC_DEFUN([gl_PREREQ_STRCASECMP], [
+ :
+])
--- /dev/null
+# strncasecmp.m4
+# serial 1
+dnl Copyright (C) 2002-2025 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl This file is offered as-is, without any warranty.
+
+AC_DEFUN([gl_FUNC_STRNCASECMP],
+[
+ AC_REQUIRE([gl_STRINGS_H_DEFAULTS])
+ AC_CHECK_FUNCS([strncasecmp])
+ if test $ac_cv_func_strncasecmp = yes; then
+ HAVE_STRNCASECMP=1
+ else
+ HAVE_STRNCASECMP=0
+ fi
+ AC_CHECK_DECLS([strncasecmp])
+ if test $ac_cv_have_decl_strncasecmp = no; then
+ HAVE_DECL_STRNCASECMP=0
+ fi
+])
+
+# Prerequisites of lib/strncasecmp.c.
+AC_DEFUN([gl_PREREQ_STRNCASECMP], [
+ :
+])
malloc-gnu
mempcpy
strndup
-strcase
+strcasecmp
extensions
vsnprintf
sleep
Description:
-Case-insensitive string comparison functions.
+Case-insensitive string comparison functions for unibyte locales.
Files:
-lib/strcasecmp.c
-lib/strncasecmp.c
-m4/strcase.m4
Depends-on:
-strings-h
+strcasecmp
+strncasecmp
configure.ac:
-gl_STRCASE
-gl_CONDITIONAL([GL_COND_OBJ_STRCASECMP], [test $HAVE_STRCASECMP = 0])
-AM_COND_IF([GL_COND_OBJ_STRCASECMP], [
- gl_PREREQ_STRCASECMP
-])
-gl_CONDITIONAL([GL_COND_OBJ_STRNCASECMP], [test $HAVE_STRNCASECMP = 0])
-AM_COND_IF([GL_COND_OBJ_STRNCASECMP], [
- gl_PREREQ_STRNCASECMP
-])
Makefile.am:
-if GL_COND_OBJ_STRCASECMP
-lib_SOURCES += strcasecmp.c
-endif
-if GL_COND_OBJ_STRNCASECMP
-lib_SOURCES += strncasecmp.c
-endif
Include:
<strings.h>
--- /dev/null
+Description:
+Case-insensitive string comparison function for unibyte locales.
+
+Files:
+lib/strcasecmp.c
+m4/strcasecmp.m4
+
+Depends-on:
+strings-h
+
+configure.ac:
+gl_FUNC_STRCASECMP
+gl_CONDITIONAL([GL_COND_OBJ_STRCASECMP], [test $HAVE_STRCASECMP = 0])
+AM_COND_IF([GL_COND_OBJ_STRCASECMP], [
+ gl_PREREQ_STRCASECMP
+])
+
+Makefile.am:
+if GL_COND_OBJ_STRCASECMP
+lib_SOURCES += strcasecmp.c
+endif
+
+Include:
+<strings.h>
+
+License:
+LGPLv2+
+
+Maintainer:
+all
Depends-on:
string-h
bool
-strcase
+strncasecmp
memchr
memcmp
extensions
--- /dev/null
+Description:
+Case-insensitive string comparison function for unibyte locales.
+
+Files:
+lib/strncasecmp.c
+m4/strncasecmp.m4
+
+Depends-on:
+strings-h
+
+configure.ac:
+gl_FUNC_STRNCASECMP
+gl_CONDITIONAL([GL_COND_OBJ_STRNCASECMP], [test $HAVE_STRNCASECMP = 0])
+AM_COND_IF([GL_COND_OBJ_STRNCASECMP], [
+ gl_PREREQ_STRNCASECMP
+])
+
+Makefile.am:
+if GL_COND_OBJ_STRNCASECMP
+lib_SOURCES += strncasecmp.c
+endif
+
+Include:
+<strings.h>
+
+License:
+LGPLv2+
+
+Maintainer:
+all
extensions
sys_time-h [test $HAVE_STRPTIME = 0]
string-h [test $HAVE_STRPTIME = 0]
-strcase [test $HAVE_STRPTIME = 0]
+strncasecmp [test $HAVE_STRPTIME = 0]
bool [test $HAVE_STRPTIME = 0]
time_r [test $HAVE_STRPTIME = 0]