diff --git a/include/boost/regex/v4/basic_regex_creator.hpp b/include/boost/regex/v4/basic_regex_creator.hpp index 51704a84..2e98ae3c 100644 --- a/include/boost/regex/v4/basic_regex_creator.hpp +++ b/include/boost/regex/v4/basic_regex_creator.hpp @@ -399,9 +399,13 @@ re_syntax_base* basic_regex_creator::append_set( last = char_set.singles_end(); while(first != last) { - charT* p = static_cast(this->m_pdata->m_data.extend(sizeof(charT) * (first->second ? 3 : 2))); + charT* p = static_cast(this->m_pdata->m_data.extend(sizeof(charT) * (first->first ? 1 : first->second ? 3 : 2))); p[0] = m_traits.translate(first->first, m_icase); - if(first->second) + if(first->first) + { + p[0] = 0; + } + else if(first->second) { p[1] = m_traits.translate(first->second, m_icase); p[2] = 0; diff --git a/include/boost/regex/v4/perl_matcher.hpp b/include/boost/regex/v4/perl_matcher.hpp index 96a086b8..b1434d07 100644 --- a/include/boost/regex/v4/perl_matcher.hpp +++ b/include/boost/regex/v4/perl_matcher.hpp @@ -161,9 +161,9 @@ iterator BOOST_REGEX_CALL re_is_set_member(iterator next, if(*p == static_cast(0)) { // treat null string as special case: - if(traits_inst.translate(*ptr, icase) != *p) + if(traits_inst.translate(*ptr, icase)) { - while(*p == static_cast(0))++p; + ++p; continue; } return set_->isnot ? next : (ptr == next) ? ++next : ptr;