From c865baa2be131a9eb050b69c37bf24d9900929d1 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 30 Jul 2012 20:55:35 +0200 Subject: [PATCH] slightly more elegant eof signalling we don't really use the current character at this point, so don't fake it and use the cur pointer as a flag. Change-Id: I0dd31ff07fafe0748b88b3a573d25b689f0c3748 Reviewed-by: Daniel Teske Reviewed-by: Oswald Buddenhagen --- src/shared/proparser/qmakeparser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/proparser/qmakeparser.cpp b/src/shared/proparser/qmakeparser.cpp index adb1f7892e1..7d84a12dbd7 100644 --- a/src/shared/proparser/qmakeparser.cpp +++ b/src/shared/proparser/qmakeparser.cpp @@ -385,6 +385,7 @@ bool QMakeParser::read(ProFile *pro, const QString &in, SubGrammar grammar) ++cur; goto flushLine; } else if (!c) { + cur = 0; goto flushLine; } else if (c != ' ' && c != '\t' && c != '\r') { break; @@ -765,7 +766,6 @@ bool QMakeParser::read(ProFile *pro, const QString &in, SubGrammar grammar) xprPtr = ptr; } } else { - c = '\n'; cur = cptr; flushLine: FLUSH_LITERAL(); @@ -795,7 +795,7 @@ bool QMakeParser::read(ProFile *pro, const QString &in, SubGrammar grammar) } else { finalizeCond(tokPtr, buf, ptr, wordCount); } - if (!c) + if (!cur) break; ++m_lineNo; goto freshLine;