mirror of
https://github.com/boostorg/regex.git
synced 2025-07-22 16:47:17 +02:00
Fixed VC7.1-STLport config setup so it works with /Zc:wchar_t
Re-ordered code in static_mutex.hpp to satisfy SGI IRIX. Added some additional #includes to satisfy SGI Irix. Fixed strange bug where some non-greedy repeats could repeat more times than permitted. Fixed return value from basic_regex<>::empty(). Fixed return value from basic_regex<>::expression() and basic_regex<>::size() when the expression is invalid. [SVN r30604]
This commit is contained in:
@ -49,9 +49,9 @@ struct regex_data
|
||||
|
||||
regex_data(const ::boost::shared_ptr<
|
||||
::boost::regex_traits_wrapper<traits> >& t)
|
||||
: m_ptraits(t) {}
|
||||
: m_ptraits(t), m_expression(0), m_expression_len(0) {}
|
||||
regex_data()
|
||||
: m_ptraits(new ::boost::regex_traits_wrapper<traits>()) {}
|
||||
: m_ptraits(new ::boost::regex_traits_wrapper<traits>()), m_expression(0), m_expression_len(0) {}
|
||||
|
||||
::boost::shared_ptr<
|
||||
::boost::regex_traits_wrapper<traits>
|
||||
@ -375,7 +375,7 @@ public:
|
||||
// empty:
|
||||
bool BOOST_REGEX_CALL empty()const
|
||||
{
|
||||
return (m_pimpl.get() ? 0 != m_pimpl->status() : 0);
|
||||
return (m_pimpl.get() ? 0 != m_pimpl->status() : true);
|
||||
}
|
||||
|
||||
size_type BOOST_REGEX_CALL mark_count()const
|
||||
|
@ -734,6 +734,14 @@ void basic_regex_creator<charT, traits>::create_startmaps(re_syntax_base* state)
|
||||
// Oops error:
|
||||
if(0 == this->m_pdata->m_status) // update the error code if not already set
|
||||
this->m_pdata->m_status = boost::regex_constants::error_brack;
|
||||
//
|
||||
// clear the expression, we should be empty:
|
||||
//
|
||||
this->m_pdata->m_expression = 0;
|
||||
this->m_pdata->m_expression_len = 0;
|
||||
//
|
||||
// and throw if required:
|
||||
//
|
||||
if(0 == (this->flags() & regex_constants::no_except))
|
||||
{
|
||||
std::string message = this->m_pdata->m_ptraits->error_string(boost::regex_constants::error_brack);
|
||||
|
@ -39,6 +39,8 @@
|
||||
#include <boost/regex/pending/object_cache.hpp>
|
||||
#endif
|
||||
|
||||
#include <istream>
|
||||
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
|
@ -61,6 +61,7 @@ typedef HANDLE _fi_find_handle;
|
||||
|
||||
#elif defined(BOOST_REGEX_FI_POSIX_DIR)
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdio>
|
||||
#include <cctype>
|
||||
#include <iterator>
|
||||
|
@ -517,8 +517,11 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_rep()
|
||||
// try and skip the repeat if we can:
|
||||
if(take_second)
|
||||
{
|
||||
// store position in case we fail:
|
||||
push_non_greedy_repeat(rep->next.p);
|
||||
if((next_count->get_count() < rep->max) && take_first)
|
||||
{
|
||||
// store position in case we fail:
|
||||
push_non_greedy_repeat(rep->next.p);
|
||||
}
|
||||
pstate = rep->alt.p;
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user