summaryrefslogtreecommitdiff
path: root/lib/libc/regex
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2017-07-07 22:00:39 +0000
committerKyle Evans <kevans@FreeBSD.org>2017-07-07 22:00:39 +0000
commit79c9a695c3ca1a2c673ba717b8763657a43f9151 (patch)
tree8f4dc11e5b6f367f17f1d00d4f4b2b248b053a64 /lib/libc/regex
parentbbbfb2a922a832b4c22dc088885119a518e3dd2e (diff)
Notes
Diffstat (limited to 'lib/libc/regex')
-rw-r--r--lib/libc/regex/regcomp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c
index 09b12ccc5a0e..d356d80c5f8b 100644
--- a/lib/libc/regex/regcomp.c
+++ b/lib/libc/regex/regcomp.c
@@ -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;
}