From 3a50c6828c87c11db07a66b3dd7ea4d2e7e223dd Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Mon, 4 Nov 2024 18:12:47 +0000 Subject: [PATCH] Restrict fix to where we really need it. --- include/boost/regex/v5/perl_matcher_non_recursive.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/boost/regex/v5/perl_matcher_non_recursive.hpp b/include/boost/regex/v5/perl_matcher_non_recursive.hpp index fb5d3edaa..92f6eb624 100644 --- a/include/boost/regex/v5/perl_matcher_non_recursive.hpp +++ b/include/boost/regex/v5/perl_matcher_non_recursive.hpp @@ -1204,8 +1204,10 @@ bool perl_matcher::skip_until_paren(int index, else if(pstate->type == syntax_element_startmark) { int idx = static_cast(pstate)->index; - match_startmark(); - pstate = pstate->next.p; + if(idx > 0) + match_startmark(); + else + pstate = pstate->next.p; skip_until_paren(idx, false); continue; }