Fix multiple occurances of tags in launch commands not being replaced.

This commit is contained in:
Aloshi 2014-11-01 12:56:32 -05:00
parent 8739519e15
commit c532c68dde

View file

@ -61,13 +61,12 @@ SystemData::~SystemData()
delete mRootFolder;
}
std::string strreplace(std::string& str, std::string replace, std::string with)
std::string strreplace(std::string str, const std::string& replace, const std::string& with)
{
size_t pos = str.find(replace);
size_t pos;
while((pos = str.find(replace)) != std::string::npos)
str = str.replace(pos, replace.length(), with.c_str(), with.length());
if(pos != std::string::npos)
return str.replace(pos, replace.length(), with.c_str(), with.length());
else
return str;
}