From: Paul Eggert Date: Mon, 23 May 2022 19:17:49 +0000 (-0700) Subject: dfa: '\n' is not governed by RE_LIMITED_OPS X-Git-Tag: v1.0~2281 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=55d1a73c1a79e94c443f51798c4c76449a0c7d62;p=gnulib.git dfa: '\n' is not governed by RE_LIMITED_OPS * lib/dfa.c (lex): Pay no attention to RE_LIMITED_OPS when deciding how to parse '\n', since regcomp.c doesn’t. --- diff --git a/ChangeLog b/ChangeLog index 0c5e799521..088e3b3134 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2022-05-23 Paul Eggert + dfa: '\n' is not governed by RE_LIMITED_OPS + * lib/dfa.c (lex): Pay no attention to RE_LIMITED_OPS when + deciding how to parse '\n', since regcomp.c doesn’t. + dfa: new option DFA_STRAY_BACKSLASH_WARN This is for grep, which wants to warn about stray backslashes that lead to unspecified behavior. For example, "grep -oi '\a'" diff --git a/lib/dfa.c b/lib/dfa.c index 4833a20d72..5d92b38b4c 100644 --- a/lib/dfa.c +++ b/lib/dfa.c @@ -1401,8 +1401,7 @@ lex (struct dfa *dfa) return dfa->lex.lasttok = OR; case '\n': - if (dfa->syntax.syntax_bits & RE_LIMITED_OPS - || !(dfa->syntax.syntax_bits & RE_NEWLINE_ALT)) + if (!(dfa->syntax.syntax_bits & RE_NEWLINE_ALT)) goto default_case; if (backslash) goto normal_char;