svn commit: r320796 - head/lib/libc/regex
Kyle Evans
kevans at FreeBSD.org
Fri Jul 7 22:00:40 UTC 2017
Author: kevans
Date: Fri Jul 7 22:00:39 2017
New Revision: 320796
URL: https://svnweb.freebsd.org/changeset/base/320796
Log:
Correctly ignore branch operators in the top-level parser when applicable.
An oversight in r320742 caused BREs to become sensitive to the branching operator prematurely, which caused
breakage in some limited situations -- namely, those that tried to use branching in a BRE. Most of these scenarios
had already been corrected beforehand to properly use gsed or grep for GNU extensions, so the damage is
slightly mitigated.
Reported by: antoine
Reported by: antoine
Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D11522
Modified:
head/lib/libc/regex/regcomp.c
Modified: head/lib/libc/regex/regcomp.c
==============================================================================
--- head/lib/libc/regex/regcomp.c Fri Jul 7 21:33:06 2017 (r320795)
+++ head/lib/libc/regex/regcomp.c Fri Jul 7 22:00:39 2017 (r320796)
@@ -672,7 +672,7 @@ p_re(struct parse *p,
bc.terminate = false;
if (p->pre_parse != NULL)
p->pre_parse(p, &bc);
- while (MORE() && !SEESPEC('|') && !SEEEND()) {
+ while (MORE() && (!p->allowbranch || !SEESPEC('|')) && !SEEEND()) {
bc.terminate = p->parse_expr(p, &bc);
++bc.nchain;
}
More information about the svn-src-all
mailing list