summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-04-18 12:50:36 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-04-18 13:29:19 (GMT)
commit5947d9b031444b48a7d7a9c70ef02d2333aeabee (patch)
treef1ef25e7be14c809c256541af64df4efbf86f823
parente2d0e0fbeb1bf7b43dc55ce55c6000819d108aee (diff)
downloadCMake-5947d9b031444b48a7d7a9c70ef02d2333aeabee.zip
CMake-5947d9b031444b48a7d7a9c70ef02d2333aeabee.tar.gz
CMake-5947d9b031444b48a7d7a9c70ef02d2333aeabee.tar.bz2
cmMakefile: Convert filenametoread into a std::string.
Remove other intermediate variables.
-rw-r--r--Source/cmMakefile.cxx20
1 files changed, 9 insertions, 11 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index eeba6aa..851e407 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -542,34 +542,32 @@ bool cmMakefile::ReadListFile(const char* filename_in,
bool noPolicyScope,
bool requireProjectCommand)
{
- std::string external_abs;
-
- const char* filenametoread = filename_in;
- std::string filename_abs;
+ std::string filenametoread;
+ if (filename_in)
+ {
+ filenametoread = filename_in;
+ }
if (external_in)
{
if (filename_in)
{
- filename_abs =
+ filenametoread =
cmSystemTools::CollapseFullPath(filename_in,
this->cmStartDirectory.c_str());
- filenametoread = filename_abs.c_str();
}
}
- if (filenametoread)
+ if (!filenametoread.empty())
{
this->cmCurrentListFile = filenametoread;
}
if (external_in)
{
- external_abs =
+ filenametoread =
cmSystemTools::CollapseFullPath(external_in,
this->cmStartDirectory.c_str());
-
- filenametoread = external_abs.c_str();
}
std::string currentParentFile
@@ -580,7 +578,7 @@ bool cmMakefile::ReadListFile(const char* filename_in,
this->AddDefinition("CMAKE_PARENT_LIST_FILE", filename_in);
this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE");
- bool res = this->ReadListFileInternal(filenametoread,
+ bool res = this->ReadListFileInternal(filenametoread.c_str(),
noPolicyScope, requireProjectCommand);
this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str());