[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] gawk branch, master, updated. gawk-4.1.0-5372-g936280d1
From: |
Eli Zaretskii |
Subject: |
[SCM] gawk branch, master, updated. gawk-4.1.0-5372-g936280d1 |
Date: |
Thu, 12 Oct 2023 08:20:30 -0400 (EDT) |
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, master has been updated
via 936280d1555c2adc99d66b8d24347a16790aed5f (commit)
from cc498e6edd43712285a4a6fdfd1568abffeaad97 (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=936280d1555c2adc99d66b8d24347a16790aed5f
commit 936280d1555c2adc99d66b8d24347a16790aed5f
Author: Eli Zaretskii <eliz@gnu.org>
Date: Thu Oct 12 15:19:58 2023 +0300
Fix processing of "\uNNNN" in the MinGW build.
diff --git a/ChangeLog b/ChangeLog
index 0b69d411..68acd35c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-10-12 Eli Zaretskii <eliz@gnu.org>
+
+ * node.c (parse_escape) [__MINGW32__]: Use w32_wc_to_lc to convert
+ Unicode codepoints.
+
+ * nonposix.h (w32_wc_to_lc) [__MINGW32__]: Add prototype.
+
2023-10-08 Arnold D. Robbins <arnold@skeeve.com>
* node.c (parse_escape): Fix warning message for \u escape.
diff --git a/node.c b/node.c
index f0bcaf12..ba1f686c 100644
--- a/node.c
+++ b/node.c
@@ -680,7 +680,9 @@ parse_escape(const char **string_ptr, const char **result,
size_t *nbytes)
case 'u':
{
size_t n;
+#ifndef __MINGW32__
mbstate_t mbs;
+#endif
if (do_lint) {
static bool warned = false;
@@ -716,8 +718,12 @@ parse_escape(const char **string_ptr, const char **result,
size_t *nbytes)
break;
}
}
+#ifdef __MINGW32__
+ n = w32_wc_to_lc (i, buf);
+#else
memset(& mbs, 0, sizeof(mbs));
n = wcrtomb(buf, i, & mbs);
+#endif /* !__MINGW32__ */
if (n == (size_t) -1) {
warning(_("invalid `\\u' escape sequence"));
retval = ESCAPE_CONV_ERR;
diff --git a/nonposix.h b/nonposix.h
index 2cffc505..a69b209c 100644
--- a/nonposix.h
+++ b/nonposix.h
@@ -65,6 +65,8 @@ char *w32_setlocale (int, const char *);
#endif
#define setlocale(c,v) w32_setlocale(c,v)
+size_t w32_wc_to_lc (int, char *);
+
char *strsignal (int);
#endif /* __MINGW32__ */
diff --git a/pc/ChangeLog b/pc/ChangeLog
index 774d5252..a44a59ad 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,7 @@
+2023-10-12 Eli Zaretskii <eliz@gnu.org>
+
+ * gawkmisc.pc (w32_wc_to_lc): New function.
+
2023-10-08 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.tst: Regenerated.
diff --git a/pc/gawkmisc.pc b/pc/gawkmisc.pc
index 2c3ebec8..2d6f9b8e 100644
--- a/pc/gawkmisc.pc
+++ b/pc/gawkmisc.pc
@@ -477,6 +477,36 @@ nl_langinfo (int item)
}
}
+/* Convert a Unicode codepoint UC to the corresponding multibyte string
+ STR in the current system codepage. Return the number of bytes in
+ STR, or -1 if the codepage does not support UC. */
+size_t w32_wc_to_lc (int uc, char *str)
+{
+ BOOL used_default = FALSE;
+ wchar_t wc[3];
+ int retval;
+
+ if (uc > 0x10FFFF)
+ return (size_t) -1;
+
+ /* Convert UC to UTF-16. */
+ wc[1] = wc[2] = 0;
+ if (uc < 0x10000)
+ wc[0] = uc;
+ else
+ {
+ wc[0] = ((uc - 0x10000) >> 10) + 0xD800; /* high surrogate */
+ wc[1] = (uc & 0x3FF) + 0xDC00; /* low surrogate */
+ }
+ /* WideCharToMultiByte returns the number of bytes, including the
+ terminating null, written to STR on success, zero on falure. */
+ retval = WideCharToMultiByte (CP_ACP, 0, wc, -1,
+ str, MB_LEN_MAX, NULL, &used_default);
+ if (!retval || used_default)
+ return (size_t) -1;
+ return retval - 1; /* exclude the terminating null */
+}
+
/*
* On MS-Windows with MinGW, execvp causes the shell and the re-exec'ed
* dgawk to compete for the keyboard input.
diff --git a/test/ChangeLog b/test/ChangeLog
index 84417d4f..5838ed62 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,7 @@
+2023-10-12 Eli Zaretskii <eliz@gnu.org>
+
+ * Makefile.am (EXPECTED_FAIL_MINGW): Add a few non-ASCII tests.
+
2023-10-09 Arnold D. Robbins <arnold@skeeve.com>
* cmdlinefsbacknl2.sh: Add sed commands after all the od
diff --git a/test/Makefile.am b/test/Makefile.am
index 323804c8..2e5eb3df 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1682,9 +1682,10 @@ NEED_LOCALE_RU = mtchi18n
EXPECTED_FAIL_MINGW = \
backbigs1 backsmalls1 clos1way6 close_status dbugeval4\
devfd devfd1 devfd2 errno exitval2 fork fork2 fts functab5 \
- getfile getlnhd ignrcas3 inetdayt inetecht inf-nan-torture \
- iolint mbfw1 mbprintf1 mbprintf4 mbstr1 mbstr2 \
- pid pipeio2 pty1 pty2 readdir rstest4 rstest5 status-close timeout
+ getfile getlnhd gsubnulli18n ignrcas3 inetdayt inetecht \
+ inf-nan-torture iolint mbfw1 mbprintf1 mbprintf4 mbstr1 \
+ mbstr2 mtchi18n2 pid pipeio2 pty1 pty2 readdir rstest4 \
+ rstest5 status-close timeout unicode1
# List of tests that fail on z/OS
EXPECTED_FAIL_ZOS = \
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 7 +++++++
node.c | 6 ++++++
nonposix.h | 2 ++
pc/ChangeLog | 4 ++++
pc/gawkmisc.pc | 30 ++++++++++++++++++++++++++++++
test/ChangeLog | 4 ++++
test/Makefile.am | 7 ++++---
7 files changed, 57 insertions(+), 3 deletions(-)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] gawk branch, master, updated. gawk-4.1.0-5372-g936280d1,
Eli Zaretskii <=