Skip to content

Commit c532c68

Browse files
committed
Fix multiple occurances of tags in launch commands not being replaced.
1 parent 8739519 commit c532c68

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

es-app/src/SystemData.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,13 @@ SystemData::~SystemData()
6161
delete mRootFolder;
6262
}
6363

64-
std::string strreplace(std::string& str, std::string replace, std::string with)
64+
std::string strreplace(std::string str, const std::string& replace, const std::string& with)
6565
{
66-
size_t pos = str.find(replace);
67-
68-
if(pos != std::string::npos)
69-
return str.replace(pos, replace.length(), with.c_str(), with.length());
70-
else
71-
return str;
66+
size_t pos;
67+
while((pos = str.find(replace)) != std::string::npos)
68+
str = str.replace(pos, replace.length(), with.c_str(), with.length());
69+
70+
return str;
7271
}
7372

7473
std::string escapePath(const boost::filesystem::path& path)

0 commit comments

Comments
 (0)