From 587e96322d66a79738b23b73089956c7283b6e7f Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Sun, 6 Sep 2009 17:33:55 +0700 Subject: [PATCH] Tokenizer(simplifyNestedStrcat): correctly set line numbers for new tokens. Pointed out by aggro80@ in IRC. Thanks! --- src/tokenize.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tokenize.cpp b/src/tokenize.cpp index 455ce2fae..8515f77ca 100644 --- a/src/tokenize.cpp +++ b/src/tokenize.cpp @@ -3370,6 +3370,7 @@ void Tokenizer::simplifyNestedStrcat() Token *end = tok2->next()->link()->next(); Token *endOfFirstArg = NULL; std::stack brackets; + unsigned int lineno = tok->next()->linenr(); // copy tokens to new place for (Token *cur = tok2; cur != end; cur = cur->next()) @@ -3388,6 +3389,10 @@ void Tokenizer::simplifyNestedStrcat() insertPos->varId(cur->varId()); } + // use line number of first strcat token for all new + // tokens + insertPos->linenr(lineno); + // linkify braces if (insertPos->str() == "(") {