stringapi: Take strings in escaping functions

This commit is contained in:
Ben Boeckel
2014-02-08 00:29:59 -05:00
committed by Brad King
parent 4c53997f38
commit 215b1addf0
8 changed files with 43 additions and 38 deletions

View File

@@ -179,10 +179,11 @@ void cmSystemTools::ExpandRegistryValues(std::string& source, KeyWOW64)
}
#endif
std::string cmSystemTools::EscapeQuotes(const char* str)
std::string cmSystemTools::EscapeQuotes(const std::string& str)
{
std::string result = "";
for(const char* ch = str; *ch != '\0'; ++ch)
std::string result;
result.reserve(str.size());
for(const char* ch = str.c_str(); *ch != '\0'; ++ch)
{
if(*ch == '"')
{