summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 9b35e61..2b17fba 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -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 == '"')
{