From 979f3b051c2db26be8ce74a996eb49f9c4ed0c77 Mon Sep 17 00:00:00 2001 From: Edoardo Prezioso Date: Fri, 28 Oct 2011 18:57:10 +0200 Subject: [PATCH] Improve nextArgument by returning 0 if there's an unexpected ';'. --- lib/token.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/token.cpp b/lib/token.cpp index 82e4746ee..f43d03c52 100644 --- a/lib/token.cpp +++ b/lib/token.cpp @@ -710,13 +710,13 @@ const Token* Token::nextArgument() const { for (const Token* tok = this; tok; tok = tok->next()) { if (tok->str() == ",") - return(tok->next()); + return tok->next(); else if (tok->str() == "(" || tok->str() == "{" || tok->str() == "[") tok = tok->link(); - else if (tok->str() == ")") - return(0); + else if (tok->str() == ")" || tok->str() == ";") + return 0; } - return(0); + return 0; } //---------------------------------------------------------------------------