diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2014-02-08 05:29:59 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-03-08 18:05:35 (GMT) |
commit | 215b1addf09359507281359cd7d478c61c01a9f2 (patch) | |
tree | 3c6feb2cda4b6d2d75916240d10b50ffc6123459 /Source/cmSystemTools.cxx | |
parent | 4c53997f3880785953e3ab6c811626b85ee67510 (diff) | |
download | CMake-215b1addf09359507281359cd7d478c61c01a9f2.zip CMake-215b1addf09359507281359cd7d478c61c01a9f2.tar.gz CMake-215b1addf09359507281359cd7d478c61c01a9f2.tar.bz2 |
stringapi: Take strings in escaping functions
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 7 |
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 == '"') { |