regex: retry due to broken connection

[SVN r8171]
This commit is contained in:
John Maddock
2000-11-11 12:10:38 +00:00
parent 31c9a1f9c6
commit 680e5b9e13
4 changed files with 10 additions and 3 deletions

View File

@ -298,7 +298,7 @@ void expand_escapes(string_type& s)
int val = 0; int val = 0;
unsigned int pos = i; unsigned int pos = i;
++i; ++i;
while( (s[i] >= BOOST_RE_STR('0')) && (s[i] <= BOOST_RE_STR('9')) && (i < s.size())) while((i < s.size()) && (s[i] >= BOOST_RE_STR('0')) && (s[i] <= BOOST_RE_STR('9')))
{ {
val *= 10; val *= 10;
val += s[i] - BOOST_RE_STR('0'); val += s[i] - BOOST_RE_STR('0');

View File

@ -201,6 +201,13 @@ struct debug_iterator : public BOOST_RE_RA_ITERATOR(T, std::ptrdiff_t)
debug_iterator() : cur(), first(), last() {} debug_iterator() : cur(), first(), last() {}
debug_iterator(const debug_iterator& x) debug_iterator(const debug_iterator& x)
: cur(x.cur), first(x.first), last(x.last) {} : cur(x.cur), first(x.first), last(x.last) {}
debug_iterator& operator=(const debug_iterator& x)
{
cur = x.cur;
first = x.first;
last = x.last;
return *this;
}
reference operator*() const reference operator*() const
{ {

View File

@ -299,7 +299,7 @@ void cpp_tests(const reg_expression<C, T, A>& e, bool recurse = true)
(m[-1].first - x) << "," << (m[-1].second - x) << ") expected (0" << (m[-1].first - x) << "," << (m[-1].second - x) << ") expected (0" <<
"," << matches[0] << ")" << endl; "," << matches[0] << ")" << endl;
} }
if(((m[-2].first != m[0].second) || (m[-2].second != y)) && ((flags[3] & match_partial) == 0)) if(((flags[3] & match_partial) == 0) && ((m[-2].first != m[0].second) || (m[-2].second != y)))
{ {
begin_error(); begin_error();
cout << "regex++ API result mismatch in $' (match -2), found (" << cout << "regex++ API result mismatch in $' (match -2), found (" <<

View File

@ -559,7 +559,7 @@ bool BOOST_RE_CALL c_regex_traits<wchar_t>::lookup_collatename(std::basic_string
scoped_array<char> buf(new char[len]); scoped_array<char> buf(new char[len]);
strnarrow(buf.get(), len, s.c_str()); strnarrow(buf.get(), len, s.c_str());
std::string t_out; std::string t_out;
bool result = do_lookup_collate(t_out, buf.get()); bool result = base_type::do_lookup_collate(t_out, buf.get());
if(t_out.size() == 0) result = false; if(t_out.size() == 0) result = false;
if(result) if(result)
{ {