[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
grep branch, master, updated. v2.21-5-g80a2817
From: |
Jim Meyering |
Subject: |
grep branch, master, updated. v2.21-5-g80a2817 |
Date: |
Sun, 07 Dec 2014 08:19:03 +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 "grep".
The branch, master has been updated
via 80a28172c1e8e17210ccbb9f3e366a828b9247c8 (commit)
via 08f909e5cfcd8ee35a6336559322dfb38087c907 (commit)
from c8b9364d5900a40809827aee6cc53705073278f6 (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.savannah.gnu.org/cgit/grep.git/commit/?id=80a28172c1e8e17210ccbb9f3e366a828b9247c8
commit 80a28172c1e8e17210ccbb9f3e366a828b9247c8
Author: Norihiro Tanaka <address@hidden>
Date: Tue Dec 2 22:58:37 2014 +0900
dfa: simplify dfaexec
* src/dfa.c (dfaexec): Simplify by rearrangement of IF conditions.
This commit induces no semantic change, and reverts part of commit
v2.5.4-144-gbafa134.
diff --git a/src/dfa.c b/src/dfa.c
index a04f77c..806cb04 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -3459,13 +3459,23 @@ dfaexec_main (struct dfa *d, char const *begin, char
*end,
}
}
- if ((char *) p > end)
+ if (s < 0)
{
- p = NULL;
- goto done;
+ if ((char *) p > end || p[-1] != eol || d->newlines[s1] < 0)
+ {
+ p = NULL;
+ goto done;
+ }
+
+ /* The previous character was a newline, count it, and skip
+ checking of multibyte character boundary until here. */
+ nlcount++;
+ mbp = p;
+
+ s = allow_nl ? d->newlines[s1] : 0;
}
- if (s >= 0 && d->fails[s])
+ if (d->fails[s])
{
if (d->success[s] & sbit[*p])
{
@@ -3479,32 +3489,13 @@ dfaexec_main (struct dfa *d, char const *begin, char
*end,
State_transition();
else
s = d->fails[s][*p++];
- continue;
- }
-
- /* If the previous character was a newline, count it, and skip
- checking of multibyte character boundary until here. */
- if (p[-1] == eol)
- {
- nlcount++;
- mbp = p;
}
-
- if (s >= 0)
+ else
{
if (!d->trans[s])
build_state (s, d);
trans = d->trans;
- continue;
}
-
- if (p[-1] != eol || d->newlines[s1] < 0)
- {
- p = NULL;
- goto done;
- }
-
- s = allow_nl ? d->newlines[s1] : 0;
}
done:
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=08f909e5cfcd8ee35a6336559322dfb38087c907
commit 80a28172c1e8e17210ccbb9f3e366a828b9247c8
Author: Norihiro Tanaka <address@hidden>
Date: Tue Dec 2 22:58:37 2014 +0900
dfa: simplify dfaexec
* src/dfa.c (dfaexec): Simplify by rearrangement of IF conditions.
This commit induces no semantic change, and reverts part of commit
v2.5.4-144-gbafa134.
diff --git a/src/dfa.c b/src/dfa.c
index a04f77c..806cb04 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -3459,13 +3459,23 @@ dfaexec_main (struct dfa *d, char const *begin, char
*end,
}
}
- if ((char *) p > end)
+ if (s < 0)
{
- p = NULL;
- goto done;
+ if ((char *) p > end || p[-1] != eol || d->newlines[s1] < 0)
+ {
+ p = NULL;
+ goto done;
+ }
+
+ /* The previous character was a newline, count it, and skip
+ checking of multibyte character boundary until here. */
+ nlcount++;
+ mbp = p;
+
+ s = allow_nl ? d->newlines[s1] : 0;
}
- if (s >= 0 && d->fails[s])
+ if (d->fails[s])
{
if (d->success[s] & sbit[*p])
{
@@ -3479,32 +3489,13 @@ dfaexec_main (struct dfa *d, char const *begin, char
*end,
State_transition();
else
s = d->fails[s][*p++];
- continue;
- }
-
- /* If the previous character was a newline, count it, and skip
- checking of multibyte character boundary until here. */
- if (p[-1] == eol)
- {
- nlcount++;
- mbp = p;
}
-
- if (s >= 0)
+ else
{
if (!d->trans[s])
build_state (s, d);
trans = d->trans;
- continue;
}
-
- if (p[-1] != eol || d->newlines[s1] < 0)
- {
- p = NULL;
- goto done;
- }
-
- s = allow_nl ? d->newlines[s1] : 0;
}
done:
-----------------------------------------------------------------------
Summary of changes:
cfg.mk | 6 +++-
src/dfa.c | 39 ++++++++-------------
tests/Makefile.am | 7 +++-
tests/{pcre-infloop => dfa-match} | 30 +++++++++++-----
tests/dfa-match-aux.c | 70 +++++++++++++++++++++++++++++++++++++
5 files changed, 116 insertions(+), 36 deletions(-)
copy tests/{pcre-infloop => dfa-match} (63%)
create mode 100644 tests/dfa-match-aux.c
hooks/post-receive
--
grep
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- grep branch, master, updated. v2.21-5-g80a2817,
Jim Meyering <=