-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
stringex & wstringex both.
Sample:
std::stringex tmp = "a";
tmp.replace("a", "aa"); // INFINITY LOOP HERE
because
` stringex &replace(const string &needle, const string &s)
{
size_type
lastpos = 0,
thispos;
while ((thispos = find(needle, lastpos)) != npos)
{
string::replace(thispos, needle.length(), s);
lastpos = thispos + 1;
}
return *this;
}
`
but need
` stringex &replace(const string &needle, const string &s)
{
size_type
lastpos = 0,
thispos;
while ((thispos = find(needle, lastpos)) != npos)
{
string::replace(thispos, needle.length(), s);
lastpos = thispos + s.length();
}
return *this;
}
`
Metadata
Metadata
Assignees
Labels
No labels