From 6e6732ae6a62869d9f56a5bcf18ac721865ef059 Mon Sep 17 00:00:00 2001 From: Moriyoshi Koizumi Date: Thu, 2 Oct 2003 08:01:14 +0000 Subject: [PATCH] Fix for a regex bug that leads into an infinite loop due to optimization failure when the pattern is ".*" and both MULTILINE and SINGLELINE options are specified. # This bug was already squashed in HEAD, as it adopts an alternative # implementation. --- ext/mbstring/mbregex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/mbstring/mbregex.c b/ext/mbstring/mbregex.c index 1e6c6effc1..cfda5b4404 100644 --- a/ext/mbstring/mbregex.c +++ b/ext/mbstring/mbregex.c @@ -3326,7 +3326,7 @@ re_search(bufp, string, size, startpos, range, regs) } } if (bufp->options & MBRE_OPTIMIZE_ANCHOR) { - if (bufp->options&MBRE_OPTION_SINGLELINE) { + if (bufp->options&MBRE_OPTION_MULTILINE & range > 0) { goto begbuf_match; } anchor = 1; -- 2.50.1