mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
Use std::replace for replacing chars in strings.
Find uses of `cmSystemTools::ReplaceString` where both `replace` and `with` are string literals with a size of one. Automate with: git grep -l ReplaceString | xargs sed -i "s|cmSystemTools::ReplaceString(\([^,]*\), \"\(.\)\", \"\(.\)\");|std::replace(\1.begin(), \1.end(), '\2', '\3');|g" git grep -l ReplaceString | xargs sed -i "s|cmSystemTools::ReplaceString(\([^,]*\), \"\(.\)\", \"\\\\\\\\\");|std::replace(\1.begin(), \1.end(), '\2', '\\\\\\\\');|g" git grep -l ReplaceString | xargs sed -i "s|cmSystemTools::ReplaceString(\([^,]*\), \"\\\\\\\\\", \"\(.\)\");|std::replace(\1.begin(), \1.end(), '\\\\\\\\', '\2');|g"
This commit is contained in:
@@ -1190,7 +1190,7 @@ std::string cmLocalUnixMakefileGenerator3::CreateMakeVariable(
|
||||
// if this there is no value for this->MakefileVariableSize then
|
||||
// the string must have bad characters in it
|
||||
if (!this->MakefileVariableSize) {
|
||||
cmSystemTools::ReplaceString(ret, ".", "_");
|
||||
std::replace(ret.begin(), ret.end(), '.', '_');
|
||||
cmSystemTools::ReplaceString(ret, "-", "__");
|
||||
cmSystemTools::ReplaceString(ret, "+", "___");
|
||||
int ni = 0;
|
||||
|
||||
Reference in New Issue
Block a user