]> Savannah Git Hosting - gnulib.git/commitdiff
fnmatch: adjust to match glibc fix
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 16 Sep 2020 22:40:20 +0000 (15:40 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 16 Sep 2020 22:40:35 +0000 (15:40 -0700)
This fixes handling of collating symbols in fnmatch (glibc bug 26620).
This does not affect Gnulib; it merely keeps Gnulib and glibc
closer together, to help with any eventual merge, by incorporating
a recent glibc patch.  The patch and the following commentary is
by Andreas Schwab.
* lib/fnmatch_loop.c (FCT) [WIDE_CHAR_VERSION]: The variable idx
contains the index into the extra array, whereas wextra points
into the extra array at this index, containing the length of the
following collating sequence in the wide character representation.

ChangeLog
lib/fnmatch_loop.c

index d18ec51a464a4dd2d935bd6a359909f35c1ce8ca..bbd420cb28801ef3f2ac886632fc64953f658f32 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2020-09-16  Paul Eggert  <eggert@cs.ucla.edu>
+
+       fnmatch: adjust to match glibc fix
+       This fixes handling of collating symbols in fnmatch (glibc bug 26620).
+       This does not affect Gnulib; it merely keeps Gnulib and glibc
+       closer together, to help with any eventual merge, by incorporating
+       a recent glibc patch.  The patch and the following commentary is
+       by Andreas Schwab.
+       * lib/fnmatch_loop.c (FCT) [WIDE_CHAR_VERSION]: The variable idx
+       contains the index into the extra array, whereas wextra points
+       into the extra array at this index, containing the length of the
+       following collating sequence in the wide character representation.
+
 2020-09-16  Bruno Haible  <bruno@clisp.org>
 
        stat, fstat: Fix compilation error with old mingw headers.
index 6050409fd92d2bff7b56ce7892d209be5c17ecac..d9be16f4c509037cf502acce65fd009cdbbdc4de 100644 (file)
@@ -549,7 +549,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
                                 /* Get the collation sequence value.  */
                                 is_seqval = true;
 # if WIDE_CHAR_VERSION
-                                cold = wextra[1 + wextra[idx]];
+                                cold = wextra[1 + wextra[0]];
 # else
                                 idx += 1 + extra[idx];
                                 /* Adjust for the alignment.  */
@@ -726,7 +726,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
                                     /* Get the collation sequence value.  */
                                     is_seqval = true;
 # if WIDE_CHAR_VERSION
-                                    cend = wextra[1 + wextra[idx]];
+                                    cend = wextra[1 + wextra[0]];
 # else
                                     idx += 1 + extra[idx];
                                     /* Adjust for the alignment.  */