Fix: re-used match_results structure didn't set size correctly.

[SVN r24744]
This commit is contained in:
John Maddock
2004-08-26 10:41:49 +00:00
parent 54be0eaa9d
commit b0a325cf65

View File

@ -73,7 +73,7 @@ public:
// size: // size:
size_type size() const size_type size() const
{ return m_subs.size() - 2; } { return (m_subs.size() >= 2) ? m_subs.size() - 2 : 0; }
size_type max_size() const size_type max_size() const
{ return m_subs.max_size(); } { return m_subs.max_size(); }
bool empty() const bool empty() const
@ -134,7 +134,7 @@ public:
} }
const_iterator begin() const const_iterator begin() const
{ {
return (m_subs.size() > 2) ? (m_subs.begin() + 2) : m_subs.end(); return (m_subs.size() >= 2) ? (m_subs.begin() + 2) : m_subs.end();
} }
const_iterator end() const const_iterator end() const
{ {
@ -218,7 +218,7 @@ public:
size_type len = m_subs.size(); size_type len = m_subs.size();
if(len > n + 2) if(len > n + 2)
{ {
m_subs.erase(m_subs.begin()+n+2); m_subs.erase(m_subs.begin()+n+2, m_subs.end());
std::fill(m_subs.begin(), m_subs.end(), v); std::fill(m_subs.begin(), m_subs.end(), v);
} }
else else