gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-4168-g1dbaf41


From: Arnold Robbins
Subject: [SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-4168-g1dbaf41
Date: Fri, 6 Nov 2020 07:16:59 -0500 (EST)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, gawk-5.1-stable has been updated
       via  1dbaf410e0b3ec754ee4ab78f861d4ef034e7962 (commit)
      from  ba3fd3d4ab19184a84720772b861c10ffb595cf0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=1dbaf410e0b3ec754ee4ab78f861d4ef034e7962

commit 1dbaf410e0b3ec754ee4ab78f861d4ef034e7962
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Fri Nov 6 14:16:40 2020 +0200

    Update support files from GNULIB.

diff --git a/support/ChangeLog b/support/ChangeLog
index edef437..174c65c 100644
--- a/support/ChangeLog
+++ b/support/ChangeLog
@@ -1,3 +1,7 @@
+2020-11-06         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * dfa.h, regex_internal.c, regex_internal.h: Synced from GNULIB.
+
 2020-11-01         Arnold D. Robbins     <arnold@skeeve.com>
 
        * dfa.c: Synced from GNULIB.
diff --git a/support/dfa.h b/support/dfa.h
index 2f77f26..6547789 100644
--- a/support/dfa.h
+++ b/support/dfa.h
@@ -18,10 +18,17 @@
 
 /* Written June, 1988 by Mike Haertel */
 
+#ifndef DFA_H_
+#define DFA_H_
+
 #include <regex.h>
 #include <stdbool.h>
 #include <stddef.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct localeinfo; /* See localeinfo.h.  */
 
 /* Element of a list of strings, at least one of which is known to
@@ -131,3 +138,9 @@ extern void dfawarn (const char *);
    takes a single argument, a NUL-terminated string describing the error.
    The user must supply a dfaerror.  */
 extern _Noreturn void dfaerror (const char *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* dfa.h */
diff --git a/support/regex_internal.c b/support/regex_internal.c
index e1b6b4d..ed0a134 100644
--- a/support/regex_internal.c
+++ b/support/regex_internal.c
@@ -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;
diff --git a/support/regex_internal.h b/support/regex_internal.h
index dbc503c..4a3cf77 100644
--- a/support/regex_internal.h
+++ b/support/regex_internal.h
@@ -77,6 +77,14 @@
 # define isblank(ch) ((ch) == ' ' || (ch) == '\t')
 #endif
 
+/* regex code assumes isascii has its usual numeric meaning,
+   even if the portable character set uses EBCDIC encoding,
+   and even if wint_t is wider than int.  */
+#ifndef _LIBC
+# undef isascii
+# define isascii(c) (((c) & ~0x7f) == 0)
+#endif
+
 #ifdef _LIBC
 # ifndef _RE_DEFINE_LOCALE_FUNCTIONS
 #  define _RE_DEFINE_LOCALE_FUNCTIONS 1

-----------------------------------------------------------------------

Summary of changes:
 support/ChangeLog        |  4 ++++
 support/dfa.h            | 13 +++++++++++++
 support/regex_internal.c | 19 ++++++++++---------
 support/regex_internal.h |  8 ++++++++
 4 files changed, 35 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]