[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gawk-diffs] [SCM] gawk branch, gawk-4.0-stable, updated. 787d93719e61e4
From: |
Arnold Robbins |
Subject: |
[gawk-diffs] [SCM] gawk branch, gawk-4.0-stable, updated. 787d93719e61e44aa1ab66c8ecca9cd6ff4fddbf |
Date: |
Sat, 01 Dec 2012 19:13:14 +0000 |
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-4.0-stable has been updated
via 787d93719e61e44aa1ab66c8ecca9cd6ff4fddbf (commit)
from a4891bca3e5b9cd33bdb8857e233042efdf77412 (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=787d93719e61e44aa1ab66c8ecca9cd6ff4fddbf
commit 787d93719e61e44aa1ab66c8ecca9cd6ff4fddbf
Author: Arnold D. Robbins <address@hidden>
Date: Sat Dec 1 21:12:41 2012 +0200
Apply realloc optimization to wide string values.
diff --git a/ChangeLog b/ChangeLog
index 6dd4c39..0b2b7f4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-12-01 Arnold D. Robbins <address@hidden>
+
+ * eval.c (r_interpret): For op_assign_concat, if both strings
+ have WSTRCUR, then do the realloc() and append for the
+ wide string too. Thanks to Janis Papanagnou
+ <address@hidden> for the discussion in
+ comp.lang.awk.
+
2012-11-10 Arnold D. Robbins <address@hidden>
* Update to bison 2.6.5. Various files regenerated.
diff --git a/eval.c b/eval.c
index 2421aea..57411af 100644
--- a/eval.c
+++ b/eval.c
@@ -2160,14 +2160,26 @@ post:
t1 = force_string(*lhs);
t2 = POP_STRING();
- free_wstr(*lhs);
-
if (t1 != t2 && t1->valref == 1 && (t1->flags & PERM)
== 0) {
size_t nlen = t1->stlen + t2->stlen;
erealloc(t1->stptr, char *, nlen + 2,
"r_interpret");
memcpy(t1->stptr + t1->stlen, t2->stptr,
t2->stlen);
t1->stlen = nlen;
t1->stptr[nlen] = '\0';
+
+#if MBS_SUPPORT
+ if ((t1->flags & WSTRCUR) != 0 && (t2->flags &
WSTRCUR) != 0) {
+ size_t wlen = t1->wstlen + t2->wstlen;
+
+ erealloc(t1->wstptr, wchar_t *,
+ sizeof(wchar_t) * (wlen
+ 2), "r_interpret");
+ memcpy(t1->wstptr + t1->wstlen,
t2->wstptr, t2->wstlen);
+ t1->wstlen = wlen;
+ t1->wstptr[wlen] = L'\0';
+ t1->flags |= WSTRCUR;
+ } else
+ free_wstr(*lhs);
+#endif
} else {
size_t nlen = t1->stlen + t2->stlen;
char *p;
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 8 ++++++++
eval.c | 16 ++++++++++++++--
2 files changed, 22 insertions(+), 2 deletions(-)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, gawk-4.0-stable, updated. 787d93719e61e44aa1ab66c8ecca9cd6ff4fddbf,
Arnold Robbins <=