Skip to content

Commit 31bf2b8

Browse files
committed
Fix lastLineTok
1 parent 2448c36 commit 31bf2b8

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

simplecpp.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1443,8 +1443,10 @@ const simplecpp::Token* simplecpp::TokenList::lastLineTok(int maxsize) const
14431443
const Token* prevTok = nullptr;
14441444
int count = 0;
14451445
for (const Token *tok = cback(); ; tok = tok->previous) {
1446-
if (!sameline(tok, cback()) || tok->locationchange)
1446+
if (!sameline(tok, cback()))
14471447
break;
1448+
if (tok->locationchange)
1449+
return tok;
14481450
if (tok->comment)
14491451
continue;
14501452
if (++count > maxsize)

0 commit comments

Comments
 (0)