Fix issues with line breaks in system font

This commit is contained in:
Henrik Rydgard 2013-08-30 17:44:44 +02:00
parent 00bc06e297
commit b505648c99
2 changed files with 17 additions and 7 deletions

View file

@ -223,11 +223,14 @@ void SplitString(const std::string& str, const char delim, std::vector<std::stri
std::string ReplaceAll(std::string result, const std::string& src, const std::string& dest)
{
size_t pos = 0;
while(1)
{
const size_t pos = result.find(src);
if (pos == result.npos) break;
pos = result.find(src, pos);
if (pos == result.npos)
break;
result.replace(pos, src.size(), dest);
pos += dest.size();
}
return result;
}