aboutsummaryrefslogtreecommitdiffstats
path: root/dfa.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2014-10-25 20:15:24 +0300
committerArnold D. Robbins <arnold@skeeve.com>2014-10-25 20:15:24 +0300
commitcbecf843696d2574accb198b84d9386eef15341c (patch)
tree869f5078f9dc528f26ea189e23e7a715a90861a4 /dfa.c
parent2c84999804e28517cf467a6ed6788aea06e146c0 (diff)
downloadegawk-cbecf843696d2574accb198b84d9386eef15341c.tar.gz
egawk-cbecf843696d2574accb198b84d9386eef15341c.tar.bz2
egawk-cbecf843696d2574accb198b84d9386eef15341c.zip
Sync dfa.c with grep.
Diffstat (limited to 'dfa.c')
-rw-r--r--dfa.c33
1 files changed, 12 insertions, 21 deletions
diff --git a/dfa.c b/dfa.c
index a53aed01..9c3901a6 100644
--- a/dfa.c
+++ b/dfa.c
@@ -3082,17 +3082,7 @@ match_mb_charset (struct dfa *d, state_num s, position pos,
int context;
/* Check syntax bits. */
- if (wc == (wchar_t) eolbyte)
- {
- if (!(syntax_bits & RE_DOT_NEWLINE))
- return 0;
- }
- else if (wc == (wchar_t) '\0')
- {
- if (syntax_bits & RE_DOT_NOT_NULL)
- return 0;
- }
- else if (wc == WEOF)
+ if (wc == WEOF)
return 0;
context = wchar_context (wc);
@@ -3422,20 +3412,20 @@ dfaexec_main (struct dfa *d, char const *begin, char *end,
continue;
}
- /* Falling back to the glibc matcher in this case gives
- better performance (up to 25% better on [a-z], for
- example) and enables support for collating symbols and
- equivalence classes. */
- if (d->states[s].has_mbcset && backref)
- {
- *backref = 1;
- goto done;
- }
-
/* The following code is used twice.
Use a macro to avoid the risk that they diverge. */
#define State_transition() \
do { \
+ /* Falling back to the glibc matcher in this case gives \
+ better performance (up to 25% better on [a-z], for \
+ example) and enables support for collating symbols and \
+ equivalence classes. */ \
+ if (d->states[s].has_mbcset && backref) \
+ { \
+ *backref = 1; \
+ goto done; \
+ } \
+ \
/* Can match with a multibyte character (and multi-character \
collating element). Transition table might be updated. */ \
s = transit_state (d, s, &p, (unsigned char *) end); \
@@ -3472,6 +3462,7 @@ dfaexec_main (struct dfa *d, char const *begin, char *end,
{
while (t[*p] == 0)
p++;
+ s1 = 0;
s = t[*p++];
}