From fb6d598813de30c5b5d8833fceae2ec8ca1744c8 Mon Sep 17 00:00:00 2001 From: Ken Martin Date: Thu, 17 Nov 2005 09:44:32 -0500 Subject: BUG: clean up scoping --- Source/cmIfCommand.cxx | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index f04f79a..c99bb73 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -136,19 +136,22 @@ bool cmIfCommand::InvokeInitialPass(const std::vector& args) return true; } -void IncrementArguments(std::list &newArgs, - std::list::iterator &argP1, - std::list::iterator &argP2) +namespace { - if (argP1 != newArgs.end()) - { - argP1++; - argP2 = argP1; + void IncrementArguments(std::list &newArgs, + std::list::iterator &argP1, + std::list::iterator &argP2) + { if (argP1 != newArgs.end()) { - argP2++; + argP1++; + argP2 = argP1; + if (argP1 != newArgs.end()) + { + argP2++; + } } - } + } } -- cgit v0.12