diff options
author | Vitaly Stakhovsky <vvs31415@gitlab.org> | 2020-01-29 17:40:00 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-01-29 19:31:01 (GMT) |
commit | bbc07e456193a90562635d7baa1f82c4dc0bd1cb (patch) | |
tree | e9862bfdc1f87c06678efc8dabd31a7e72142789 /Source/cmLocalUnixMakefileGenerator3.cxx | |
parent | feea34e7eb483e8db28947920757612a95ab1863 (diff) | |
download | CMake-bbc07e456193a90562635d7baa1f82c4dc0bd1cb.zip CMake-bbc07e456193a90562635d7baa1f82c4dc0bd1cb.tar.gz CMake-bbc07e456193a90562635d7baa1f82c4dc0bd1cb.tar.bz2 |
Source: use std::string in place of const char*
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 1420f7c..d037b93 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1972,18 +1972,18 @@ void cmLocalUnixMakefileGenerator3::WriteDivider(std::ostream& os) } void cmLocalUnixMakefileGenerator3::WriteCMakeArgument(std::ostream& os, - const char* s) + const std::string& s) { // Write the given string to the stream with escaping to get it back // into CMake through the lexical scanner. os << "\""; - for (const char* c = s; *c; ++c) { - if (*c == '\\') { + for (char c : s) { + if (c == '\\') { os << "\\\\"; - } else if (*c == '"') { + } else if (c == '"') { os << "\\\""; } else { - os << *c; + os << c; } } os << "\""; |