summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/cmFunctionCommand.cxx3
-rw-r--r--Source/cmMacroCommand.cxx3
-rw-r--r--Source/cmMakefile.cxx23
-rw-r--r--Source/cmMakefile.h7
4 files changed, 12 insertions, 24 deletions
diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx
index b6f58bd054..46bd05770d 100644
--- a/Source/cmFunctionCommand.cxx
+++ b/Source/cmFunctionCommand.cxx
@@ -147,8 +147,7 @@ bool cmFunctionFunctionBlocker::ArgumentsMatch(cmListFileFunction const& lff,
cmMakefile& mf) const
{
std::vector<std::string> expandedArguments;
- mf.ExpandArguments(lff.Arguments, expandedArguments,
- this->GetStartingContext().FilePath.c_str());
+ mf.ExpandArguments(lff.Arguments, expandedArguments);
return expandedArguments.empty() ||
expandedArguments.front() == this->Args.front();
}
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index c88b343182..91a600e096 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -157,8 +157,7 @@ bool cmMacroFunctionBlocker::ArgumentsMatch(cmListFileFunction const& lff,
cmMakefile& mf) const
{
std::vector<std::string> expandedArguments;
- mf.ExpandArguments(lff.Arguments, expandedArguments,
- this->GetStartingContext().FilePath.c_str());
+ mf.ExpandArguments(lff.Arguments, expandedArguments);
return expandedArguments.empty() || expandedArguments[0] == this->Args[0];
}
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index e529896e65..2147026a8d 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3335,13 +3335,9 @@ std::string const& cmMakefile::GetExecutionFilePath() const
}
bool cmMakefile::ExpandArguments(std::vector<cmListFileArgument> const& inArgs,
- std::vector<std::string>& outArgs,
- const char* filename) const
+ std::vector<std::string>& outArgs) const
{
- if (!filename) {
- auto const& efp = this->GetExecutionFilePath();
- filename = efp.c_str();
- }
+ std::string const& filename = this->GetExecutionFilePath();
std::string value;
outArgs.reserve(inArgs.size());
for (cmListFileArgument const& i : inArgs) {
@@ -3352,8 +3348,8 @@ bool cmMakefile::ExpandArguments(std::vector<cmListFileArgument> const& inArgs,
}
// Expand the variables in the argument.
value = i.Value;
- this->ExpandVariablesInString(value, false, false, false, filename, i.Line,
- false, false);
+ this->ExpandVariablesInString(value, false, false, false, filename.c_str(),
+ i.Line, false, false);
// If the argument is quoted, it should be one argument.
// Otherwise, it may be a list of arguments.
@@ -3368,12 +3364,9 @@ bool cmMakefile::ExpandArguments(std::vector<cmListFileArgument> const& inArgs,
bool cmMakefile::ExpandArguments(
std::vector<cmListFileArgument> const& inArgs,
- std::vector<cmExpandedCommandArgument>& outArgs, const char* filename) const
+ std::vector<cmExpandedCommandArgument>& outArgs) const
{
- if (!filename) {
- auto const& efp = this->GetExecutionFilePath();
- filename = efp.c_str();
- }
+ std::string const& filename = this->GetExecutionFilePath();
std::string value;
outArgs.reserve(inArgs.size());
for (cmListFileArgument const& i : inArgs) {
@@ -3384,8 +3377,8 @@ bool cmMakefile::ExpandArguments(
}
// Expand the variables in the argument.
value = i.Value;
- this->ExpandVariablesInString(value, false, false, false, filename, i.Line,
- false, false);
+ this->ExpandVariablesInString(value, false, false, false, filename.c_str(),
+ i.Line, false, false);
// If the argument is quoted, it should be one argument.
// Otherwise, it may be a list of arguments.
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index bd7753ae5c..022c0297b7 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -732,12 +732,9 @@ public:
* variable replacement and list expansion.
*/
bool ExpandArguments(std::vector<cmListFileArgument> const& inArgs,
- std::vector<std::string>& outArgs,
- const char* filename = nullptr) const;
-
+ std::vector<std::string>& outArgs) const;
bool ExpandArguments(std::vector<cmListFileArgument> const& inArgs,
- std::vector<cmExpandedCommandArgument>& outArgs,
- const char* filename = nullptr) const;
+ std::vector<cmExpandedCommandArgument>& outArgs) const;
/**
* Get the instance