From: Paul Eggert Date: Wed, 16 Sep 2020 22:40:20 +0000 (-0700) Subject: fnmatch: adjust to match glibc fix X-Git-Tag: v1.0~3631 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=c06bbace6ef996131ccd88df0afe679e4ecc078c;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index d18ec51a46..bbd420cb28 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2020-09-16 Paul Eggert + + 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 stat, fstat: Fix compilation error with old mingw headers. diff --git a/lib/fnmatch_loop.c b/lib/fnmatch_loop.c index 6050409fd9..d9be16f4c5 100644 --- a/lib/fnmatch_loop.c +++ b/lib/fnmatch_loop.c @@ -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. */