diff --git a/include/boost/re_detail/regex_compile.hpp b/include/boost/re_detail/regex_compile.hpp index bea3d1f4..adff8987 100644 --- a/include/boost/re_detail/regex_compile.hpp +++ b/include/boost/re_detail/regex_compile.hpp @@ -1959,12 +1959,12 @@ unsigned int BOOST_RE_CALL reg_expression::fixup_leadi leading_lit = false; break; case re_detail::syntax_element_rep: - if(1 == fixup_leading_rep(dat->next.p, ((re_detail::re_repeat*)dat)->alt.p) ) + if((len == 0) && (1 == fixup_leading_rep(dat->next.p, ((re_detail::re_repeat*)dat)->alt.p) )) { ((re_detail::re_repeat*)dat)->leading = true; return len; } - return 0; + return len; default: break; } diff --git a/src/regex_debug.cpp b/src/regex_debug.cpp index bdbf5464..a127f3ed 100644 --- a/src/regex_debug.cpp +++ b/src/regex_debug.cpp @@ -24,13 +24,13 @@ #include #include #include -#include #ifdef BOOST_MSVC #include #endif #ifdef BOOST_RE_DEBUG +#include namespace boost { namespace re_detail { std::ostream& operator<<(std::ostream& s, syntax_element_type x) @@ -206,3 +206,4 @@ debug_guard::~debug_guard() #endif +