summaryrefslogtreecommitdiff
path: root/Source/cmCPluginAPI.cxx
diff options
context:
space:
mode:
authorVitaly Stakhovsky <vvs31415@gitlab.org>2018-04-27 11:28:30 -0400
committerBrad King <brad.king@kitware.com>2018-05-01 10:24:31 -0400
commite13fa223fc870ea95c6a1cfa09b61b527a1c2db5 (patch)
tree484e5094c95c38d4d3b65599020f9daadf44e98d /Source/cmCPluginAPI.cxx
parentb542e0c74f543954ba26048ce38776269b9ba203 (diff)
downloadcmake-e13fa223fc870ea95c6a1cfa09b61b527a1c2db5.tar.gz
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/cmCPluginAPI.cxx')
-rw-r--r--Source/cmCPluginAPI.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx
index e6d7f8fcbf..8e7e3ad5ad 100644
--- a/Source/cmCPluginAPI.cxx
+++ b/Source/cmCPluginAPI.cxx
@@ -405,7 +405,8 @@ char CCONV* cmExpandVariablesInString(void* arg, const char* source,
{
cmMakefile* mf = static_cast<cmMakefile*>(arg);
std::string barf = source;
- std::string result = mf->ExpandVariablesInString(barf, escapeQuotes, atOnly);
+ std::string const& result =
+ mf->ExpandVariablesInString(barf, escapeQuotes, atOnly);
return strdup(result.c_str());
}