diff options
Diffstat (limited to 'Source/cmSetCommand.cxx')
-rw-r--r-- | Source/cmSetCommand.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index 985aac8..1a2d1c6 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -54,7 +54,7 @@ bool cmSetCommand::InitialPass(std::vector<std::string> const& args, } // SET (VAR PARENT_SCOPE) // Removes the definition of VAR // in the parent scope. - if (args.size() == 2 && args[args.size() - 1] == "PARENT_SCOPE") { + if (args.size() == 2 && args.back() == "PARENT_SCOPE") { this->Makefile->RaiseScope(variable, nullptr); return true; } @@ -74,12 +74,12 @@ bool cmSetCommand::InitialPass(std::vector<std::string> const& args, unsigned int ignoreLastArgs = 0; // look for PARENT_SCOPE argument - if (args.size() > 1 && args[args.size() - 1] == "PARENT_SCOPE") { + if (args.size() > 1 && args.back() == "PARENT_SCOPE") { parentScope = true; ignoreLastArgs++; } else { // look for FORCE argument - if (args.size() > 4 && args[args.size() - 1] == "FORCE") { + if (args.size() > 4 && args.back() == "FORCE") { force = true; ignoreLastArgs++; } @@ -103,7 +103,7 @@ bool cmSetCommand::InitialPass(std::vector<std::string> const& args, // we should be nice and try to catch some simple screwups if the last or // next to last args are CACHE then they screwed up. If they used FORCE // without CACHE they screwed up - if ((args[args.size() - 1] == "CACHE") || + if ((args.back() == "CACHE") || (args.size() > 1 && args[args.size() - 2] == "CACHE") || (force && !cache)) { this->SetError("given invalid arguments for CACHE mode."); |