[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-725
From: |
Arnold Robbins |
Subject: |
[gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-725-g6a7fee2 |
Date: |
Sat, 18 Jul 2015 19:05:35 +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.1-stable has been updated
via 6a7fee22e26533467b221c5773d600c7b7a189d1 (commit)
from 2eee1b8e780b00062b2a8eef649ebbebaba4682c (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=6a7fee22e26533467b221c5773d600c7b7a189d1
commit 6a7fee22e26533467b221c5773d600c7b7a189d1
Author: Arnold D. Robbins <address@hidden>
Date: Sat Jul 18 22:05:16 2015 +0300
Sync dfa.c with GNU grep.
diff --git a/ChangeLog b/ChangeLog
index 41c55da..37ca3fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2015-07-18 Arnold D. Robbins <address@hidden>
+
+ * dfa.c: Sync with GNU grep.
+
2015-07-08 Arnold D. Robbins <address@hidden>
* dfa.h, dfa.c: Sync with GNU grep.
diff --git a/dfa.c b/dfa.c
index 95cd927..c3a5d88 100644
--- a/dfa.c
+++ b/dfa.c
@@ -4007,13 +4007,13 @@ struct must
};
static must *
-allocmust (must *mp)
+allocmust (must *mp, size_t size)
{
must *new_mp = xmalloc (sizeof *new_mp);
new_mp->in = xzalloc (sizeof *new_mp->in);
- new_mp->left = xzalloc (2);
- new_mp->right = xzalloc (2);
- new_mp->is = xzalloc (2);
+ new_mp->left = xzalloc (size);
+ new_mp->right = xzalloc (size);
+ new_mp->is = xzalloc (size);
new_mp->begline = false;
new_mp->endline = false;
new_mp->prev = mp;
@@ -4058,11 +4058,11 @@ dfamust (struct dfa const *d)
switch (t)
{
case BEGLINE:
- mp = allocmust (mp);
+ mp = allocmust (mp, 2);
mp->begline = true;
break;
case ENDLINE:
- mp = allocmust (mp);
+ mp = allocmust (mp, 2);
mp->endline = true;
break;
case LPAREN:
@@ -4077,7 +4077,7 @@ dfamust (struct dfa const *d)
case BACKREF:
case ANYCHAR:
case MBCSET:
- mp = allocmust (mp);
+ mp = allocmust (mp, 2);
break;
case STAR:
@@ -4194,7 +4194,6 @@ dfamust (struct dfa const *d)
goto done;
default:
- mp = allocmust (mp);
if (CSET <= t)
{
/* If T is a singleton, or if case-folding in a unibyte
@@ -4207,7 +4206,10 @@ dfamust (struct dfa const *d)
if (tstbit (j, *ccl))
break;
if (! (j < NOTCHAR))
- break;
+ {
+ mp = allocmust (mp, 2);
+ break;
+ }
t = j;
while (++j < NOTCHAR)
if (tstbit (j, *ccl)
@@ -4215,12 +4217,36 @@ dfamust (struct dfa const *d)
&& toupper (j) == toupper (t)))
break;
if (j < NOTCHAR)
- break;
+ {
+ mp = allocmust (mp, 2);
+ break;
+ }
}
+
+ size_t rj = ri + 2;
+ if (d->tokens[ri + 1] == CAT)
+ {
+ for (; rj < d->tindex - 1; rj += 2)
+ {
+ if ((rj != ri && (d->tokens[rj] <= 0
+ || NOTCHAR <= d->tokens[rj]))
+ || d->tokens[rj + 1] != CAT)
+ break;
+ }
+ }
+ mp = allocmust (mp, ((rj - ri) >> 1) + 1);
mp->is[0] = mp->left[0] = mp->right[0]
= case_fold && MB_CUR_MAX == 1 ? toupper (t) : t;
- mp->is[1] = mp->left[1] = mp->right[1] = '\0';
- mp->in = enlist (mp->in, mp->is, 1);
+
+ for (i = 1; ri + 2 < rj; i++)
+ {
+ ri += 2;
+ t = d->tokens[ri];
+ mp->is[i] = mp->left[i] = mp->right[i]
+ = case_fold && MB_CUR_MAX == 1 ? toupper (t) : t;
+ }
+ mp->is[i] = mp->left[i] = mp->right[i] = '\0';
+ mp->in = enlist (mp->in, mp->is, i - 1);
break;
}
}
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 4 ++++
dfa.c | 50 ++++++++++++++++++++++++++++++++++++++------------
2 files changed, 42 insertions(+), 12 deletions(-)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-725-g6a7fee2,
Arnold Robbins <=