]> Savannah Git Hosting - gnulib.git/commitdiff
*_l: Fix mistake.
authorBruno Haible <bruno@clisp.org>
Thu, 20 Feb 2025 15:09:49 +0000 (16:09 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 20 Feb 2025 15:16:44 +0000 (16:16 +0100)
* lib/is_l-impl.h (FUNC): Fix array index on old NetBSD and OpenBSD.
* lib/to_l-impl.h (FUNC): Likewise.
* lib/strcasecmp_l.c (strcasecmp_l): Likewise.
* lib/strncasecmp_l.c (strncasecmp_l): Likewise.
* lib/strerror_l.c (strerror_l_r): Likewise.

ChangeLog
lib/is_l-impl.h
lib/strcasecmp_l.c
lib/strerror_l.c
lib/strncasecmp_l.c
lib/to_l-impl.h

index 4c7b04829ae5608583daf7066d64e1239718d093..492aeadb96c83444363ff988c5fbd90c5329dd28 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2025-02-20  Bruno Haible  <bruno@clisp.org>
+
+       *_l: Fix mistake.
+       * lib/is_l-impl.h (FUNC): Fix array index on old NetBSD and OpenBSD.
+       * lib/to_l-impl.h (FUNC): Likewise.
+       * lib/strcasecmp_l.c (strcasecmp_l): Likewise.
+       * lib/strncasecmp_l.c (strncasecmp_l): Likewise.
+       * lib/strerror_l.c (strerror_l_r): Likewise.
+
 2025-02-19  Bruno Haible  <bruno@clisp.org>
 
        readutmp: Let callers distinguish LOGINs from USERs.
index 27de6de8986ae94e16b60e4b3e87172f9c8be427..46946e97bd96f2c09cc15ced784194b7ac1a5930 100644 (file)
@@ -23,7 +23,7 @@ int
 FUNC (int c, locale_t locale)
 {
   struct gl_locale_category_t *plc =
-    &locale->category[gl_log2_lc_mask (LC_CTYPE)];
+    &locale->category[gl_log2_lcmask_to_index (gl_log2_lc_mask (LC_CTYPE))];
   if (plc->is_c_locale)
     /* Implementation for the "C" locale.  */
     return C_FUNC (c);
index 6ed2a72f8d9910fd27347063f4a63c215bbd8ead..07ffee2f7f6d32b8361cab32d3edd184d9314180 100644 (file)
@@ -29,7 +29,7 @@ strcasecmp_l (const char *s1, const char *s2, locale_t locale)
 #if GNULIB_defined_locale_t
 
   struct gl_locale_category_t *plc =
-    &locale->category[gl_log2_lc_mask (LC_CTYPE)];
+    &locale->category[gl_log2_lcmask_to_index (gl_log2_lc_mask (LC_CTYPE))];
   if (plc->is_c_locale)
     /* Implementation for the "C" locale.  */
     return c_strcasecmp (s1, s2);
index 1c2764c5f7794ca18905e5e32ed3ffba4b9fee65..8203088a55fb04b2af5f8cda544be8736afb5ab1 100644 (file)
@@ -120,7 +120,7 @@ strerror_l_r (int errnum, char *buf, size_t buflen, locale_t locale)
 #if GNULIB_defined_locale_t
 
   struct gl_locale_category_t *plc =
-    &locale->category[gl_log2_lc_mask (LC_MESSAGES)];
+    &locale->category[gl_log2_lcmask_to_index (gl_log2_lc_mask (LC_MESSAGES))];
   if (plc->is_c_locale)
     {
       /* Implementation for the "C" locale.  */
index c049015caf148e253d758f2aedb25e2274964bfd..04219c5c9549bcf5eb2de94640a8a55706f73025 100644 (file)
@@ -29,7 +29,7 @@ strncasecmp_l (const char *s1, const char *s2, size_t n, locale_t locale)
 #if GNULIB_defined_locale_t
 
   struct gl_locale_category_t *plc =
-    &locale->category[gl_log2_lc_mask (LC_CTYPE)];
+    &locale->category[gl_log2_lcmask_to_index (gl_log2_lc_mask (LC_CTYPE))];
   if (plc->is_c_locale)
     /* Implementation for the "C" locale.  */
     return c_strncasecmp (s1, s2, n);
index 63816aee3c4c85eeb55bd53a2318ced637416c58..d7bd166cc193a2944d08b47e8ddc4d5b29a0002a 100644 (file)
@@ -23,7 +23,7 @@ int
 FUNC (int c, locale_t locale)
 {
   struct gl_locale_category_t *plc =
-    &locale->category[gl_log2_lc_mask (LC_CTYPE)];
+    &locale->category[gl_log2_lcmask_to_index (gl_log2_lc_mask (LC_CTYPE))];
   if (plc->is_c_locale)
     /* Implementation for the "C" locale.  */
     return C_FUNC (c);