diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-07-28 14:01:58 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2019-07-28 15:47:26 (GMT) |
commit | 2c5454f227027552966519c40feb2732b37ec542 (patch) | |
tree | 3fe016425ddc6b43a2da3000f351d7cb78c6ea30 /Source/cmSystemTools.cxx | |
parent | ad3183db8cbc15d25b9326b5b479eba01e87f30a (diff) | |
download | CMake-2c5454f227027552966519c40feb2732b37ec542.zip CMake-2c5454f227027552966519c40feb2732b37ec542.tar.gz CMake-2c5454f227027552966519c40feb2732b37ec542.tar.bz2 |
cmSystemTool: Let EscapeQuotes accept a cm::string_view
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 1e9580c..3715cc6 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -176,15 +176,15 @@ void cmSystemTools::ExpandRegistryValues(std::string& source, } #endif -std::string cmSystemTools::EscapeQuotes(const std::string& str) +std::string cmSystemTools::EscapeQuotes(cm::string_view str) { std::string result; result.reserve(str.size()); - for (const char* ch = str.c_str(); *ch != '\0'; ++ch) { - if (*ch == '"') { + for (const char ch : str) { + if (ch == '"') { result += '\\'; } - result += *ch; + result += ch; } return result; } |