]> Savannah Git Hosting - gnulib.git/commitdiff
regex: no longer match glibc
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 25 Sep 2020 21:38:06 +0000 (14:38 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 25 Sep 2020 21:39:28 +0000 (14:39 -0700)
* config/srclist.txt: Comment out regex_internal.c for now.

ChangeLog
config/srclist.txt
lib/regex_internal.c

index 5c4d8f849240fd750e13789cb7ac6d716eeef736..2ed322e68cc396d1dd02e626f00d60a506199324 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2020-09-25  Paul Eggert  <eggert@cs.ucla.edu>
+
+       regex: no longer match glibc
+       * config/srclist.txt: Comment out regex_internal.c for now.
+
 2020-09-23  Paul Eggert  <eggert@cs.ucla.edu>
 
        regex: fix ignore-case Turkish bug
index c1ac3e1a181e03f4ac107fee7f9d1f4b2d5bb3c0..02e84382949c3c4cb7c461fd986205c609abe8f0 100644 (file)
@@ -57,7 +57,7 @@ $LIBCSRC malloc/scratch_buffer_set_array_size.c       lib/malloc
 #$LIBCSRC posix/regcomp.c              lib
 $LIBCSRC posix/regex.c                 lib
 #$LIBCSRC posix/regex.h                        lib
-$LIBCSRC posix/regex_internal.c                lib
+#$LIBCSRC posix/regex_internal.c       lib
 #$LIBCSRC posix/regex_internal.h               lib
 $LIBCSRC posix/regexec.c               lib
 $LIBCSRC time/timegm.c                 lib
index e1b6b4d5af7f71eae296657d6a4a7a3e1bc11128..ed0a13461bd8fcf1ec616ce4aef94d207e456d58 100644 (file)
@@ -300,18 +300,20 @@ build_wcs_upper_buffer (re_string_t *pstr)
       while (byte_idx < end_idx)
        {
          wchar_t wc;
+         unsigned char ch = pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx];
 
-         if (isascii (pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx])
-             && mbsinit (&pstr->cur_state))
+         if (isascii (ch) && mbsinit (&pstr->cur_state))
            {
-             /* In case of a singlebyte character.  */
-             pstr->mbs[byte_idx]
-               = toupper (pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx]);
              /* The next step uses the assumption that wchar_t is encoded
                 ASCII-safe: all ASCII values can be converted like this.  */
-             pstr->wcs[byte_idx] = (wchar_t) pstr->mbs[byte_idx];
-             ++byte_idx;
-             continue;
+             wchar_t wcu = __towupper (ch);
+             if (isascii (wcu))
+               {
+                 pstr->mbs[byte_idx] = wcu;
+                 pstr->wcs[byte_idx] = wcu;
+                 byte_idx++;
+                 continue;
+               }
            }
 
          remain_len = end_idx - byte_idx;
@@ -348,7 +350,6 @@ build_wcs_upper_buffer (re_string_t *pstr)
            {
              /* It is an invalid character, an incomplete character
                 at the end of the string, or '\0'.  Just use the byte.  */
-             int ch = pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx];
              pstr->mbs[byte_idx] = ch;
              /* And also cast it to wide char.  */
              pstr->wcs[byte_idx++] = (wchar_t) ch;