From 0dd8054d05d8286f2f7cbcf85456c6953a9b6146 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 30 Nov 2016 21:27:52 +0200 Subject: Sync dfa with GNULIB. --- dfa.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'dfa.c') diff --git a/dfa.c b/dfa.c index 0a231050..ae64ba95 100644 --- a/dfa.c +++ b/dfa.c @@ -2652,6 +2652,12 @@ dfastate (state_num s, struct dfa *d, unsigned char uc, state_num trans[]) continue; if (j == CHARCLASS_WORDS) continue; + + /* If we have reset the bit that made us declare "matched", reset + that indicator, too. This is required to avoid an infinite loop + with this command: echo cx | LC_ALL=C grep -E 'c\b[x ]' */ + if (!tstbit (uc, matches)) + matched = false; } #ifdef DEBUG -- cgit v1.2.3