summaryrefslogtreecommitdiffstats
path: root/Source/cmMacroCommand.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-02-11 19:23:36 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-02-11 21:58:34 (GMT)
commit2c4a7298fcb3ac6a6b6c0a9545b343c814f3d6ec (patch)
tree8f3b956e9ae72997424cd8094b2b576d157c1ca1 /Source/cmMacroCommand.cxx
parenta551851ab3f23f58074638ffcf38a08d98a35fa8 (diff)
downloadCMake-2c4a7298fcb3ac6a6b6c0a9545b343c814f3d6ec.zip
CMake-2c4a7298fcb3ac6a6b6c0a9545b343c814f3d6ec.tar.gz
CMake-2c4a7298fcb3ac6a6b6c0a9545b343c814f3d6ec.tar.bz2
cmMacroCommand: Declare arg in the scope that it is used.
It can make sense to declare objects outside of loops if the size required by the object can grow (eg std::string when using getline), but that is not the case here.
Diffstat (limited to 'Source/cmMacroCommand.cxx')
-rw-r--r--Source/cmMacroCommand.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index 6f45484..bd53b1e 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -85,7 +85,6 @@ bool cmMacroHelperCommand::InvokeInitialPass
this->Makefile->ExpandArguments(args, expandedArgs);
std::string tmps;
- cmListFileArgument arg;
// make sure the number of arguments passed is at least the number
// required by the signature
@@ -144,6 +143,8 @@ bool cmMacroHelperCommand::InvokeInitialPass
// Set the FilePath on the arguments to match the function since it is
// not stored and the original values may be freed
k->FilePath = this->FilePath.c_str();
+
+ cmListFileArgument arg;
if(k->Delim == cmListFileArgument::Bracket)
{
arg.Value = k->Value;