summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorVitaly Stakhovsky <vvs31415@gitlab.org>2018-04-27 15:28:30 (GMT)
committerBrad King <brad.king@kitware.com>2018-05-01 14:24:31 (GMT)
commite13fa223fc870ea95c6a1cfa09b61b527a1c2db5 (patch)
tree484e5094c95c38d4d3b65599020f9daadf44e98d /Source/cmMakefile.cxx
parentb542e0c74f543954ba26048ce38776269b9ba203 (diff)
downloadCMake-e13fa223fc870ea95c6a1cfa09b61b527a1c2db5.zip
CMake-e13fa223fc870ea95c6a1cfa09b61b527a1c2db5.tar.gz
CMake-e13fa223fc870ea95c6a1cfa09b61b527a1c2db5.tar.bz2
cmMakefile: Improve ExpandVariablesInString return type
Return `std::string const&` instead of a `const char*` that points into a string anyway. Update call sites accordingly.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index b6bf08b..53f0a3d 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2412,12 +2412,13 @@ std::vector<std::string> cmMakefile::GetDefinitions() const
return res;
}
-const char* cmMakefile::ExpandVariablesInString(std::string& source) const
+const std::string& cmMakefile::ExpandVariablesInString(
+ std::string& source) const
{
return this->ExpandVariablesInString(source, false, false);
}
-const char* cmMakefile::ExpandVariablesInString(
+const std::string& cmMakefile::ExpandVariablesInString(
std::string& source, bool escapeQuotes, bool noEscapes, bool atOnly,
const char* filename, long line, bool removeEmpty, bool replaceAt) const
{
@@ -2433,7 +2434,7 @@ const char* cmMakefile::ExpandVariablesInString(
this->IssueMessage(cmake::INTERNAL_ERROR,
"ExpandVariablesInString @ONLY called "
"on something with escapes.");
- return source.c_str();
+ return source;
}
// Variables used in the WARN case.
@@ -2515,7 +2516,7 @@ const char* cmMakefile::ExpandVariablesInString(
this->IssueMessage(cmake::AUTHOR_WARNING, msg);
}
- return source.c_str();
+ return source;
}
cmake::MessageType cmMakefile::ExpandVariablesInStringOld(