]> Savannah Git Hosting - gnulib.git/commitdiff
dfa: '\n' is not governed by RE_LIMITED_OPS
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 23 May 2022 19:17:49 +0000 (12:17 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 23 May 2022 19:18:54 +0000 (12:18 -0700)
* lib/dfa.c (lex): Pay no attention to RE_LIMITED_OPS when
deciding how to parse '\n', since regcomp.c doesn’t.

ChangeLog
lib/dfa.c

index 0c5e799521f96b0faab085c853bc905117386efa..088e3b3134d0f41c0676299ffcb1f09aaa3144fa 100644 (file)
--- 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'"
index 4833a20d72819d02bc7177f79429a064bb01ab74..5d92b38b4cae4194e88bf6dc4d88e0eb83ae2ad8 100644 (file)
--- 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;