summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2019-07-28 14:01:58 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2019-07-28 15:47:26 (GMT)
commit2c5454f227027552966519c40feb2732b37ec542 (patch)
tree3fe016425ddc6b43a2da3000f351d7cb78c6ea30 /Source/cmSystemTools.cxx
parentad3183db8cbc15d25b9326b5b479eba01e87f30a (diff)
downloadCMake-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.cxx8
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;
}