diff options
Diffstat (limited to 'Source/cmGetFilenameComponentCommand.cxx')
-rw-r--r-- | Source/cmGetFilenameComponentCommand.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/cmGetFilenameComponentCommand.cxx b/Source/cmGetFilenameComponentCommand.cxx index 1b358ab..ffb895e 100644 --- a/Source/cmGetFilenameComponentCommand.cxx +++ b/Source/cmGetFilenameComponentCommand.cxx @@ -19,8 +19,8 @@ bool cmGetFilenameComponentCommand::InitialPass( // Check and see if the value has been stored in the cache // already, if so use that value - if (args.size() >= 4 && args[args.size() - 1] == "CACHE") { - const char* cacheValue = this->Makefile->GetDefinition(args[0]); + if (args.size() >= 4 && args.back() == "CACHE") { + const char* cacheValue = this->Makefile->GetDefinition(args.front()); if (cacheValue && !cmSystemTools::IsNOTFOUND(cacheValue)) { return true; } @@ -113,20 +113,20 @@ bool cmGetFilenameComponentCommand::InitialPass( return false; } - if (args.size() >= 4 && args[args.size() - 1] == "CACHE") { + if (args.size() >= 4 && args.back() == "CACHE") { if (!programArgs.empty() && !storeArgs.empty()) { this->Makefile->AddCacheDefinition( storeArgs, programArgs.c_str(), "", args[2] == "PATH" ? cmStateEnums::FILEPATH : cmStateEnums::STRING); } this->Makefile->AddCacheDefinition( - args[0], result.c_str(), "", + args.front(), result.c_str(), "", args[2] == "PATH" ? cmStateEnums::FILEPATH : cmStateEnums::STRING); } else { if (!programArgs.empty() && !storeArgs.empty()) { this->Makefile->AddDefinition(storeArgs, programArgs.c_str()); } - this->Makefile->AddDefinition(args[0], result.c_str()); + this->Makefile->AddDefinition(args.front(), result.c_str()); } return true; |