From e345f05fa9f0ef4d2f547619bd8f6d55ba98491e Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sat, 30 Sep 2000 10:36:58 +0000 Subject: [PATCH] minor regex fixes [SVN r7878] --- include/boost/re_detail/regex_compile.hpp | 4 ++-- src/regex_debug.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) 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 +