[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/3] dfa: '\n' is not governed by RE_LIMITED_OPS
From: |
Paul Eggert |
Subject: |
[PATCH 3/3] dfa: '\n' is not governed by RE_LIMITED_OPS |
Date: |
Mon, 23 May 2022 12:19:12 -0700 |
* lib/dfa.c (lex): Pay no attention to RE_LIMITED_OPS when
deciding how to parse '\n', since regcomp.c doesn’t.
---
ChangeLog | 4 ++++
lib/dfa.c | 3 +--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 0c5e799521..088e3b3134 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2022-05-23 Paul Eggert <eggert@cs.ucla.edu>
+ 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;
--
2.36.1