summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/linguist/lupdate/cpp.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp
index c224e2f..b8f8451 100644
--- a/tools/linguist/lupdate/cpp.cpp
+++ b/tools/linguist/lupdate/cpp.cpp
@@ -1174,16 +1174,18 @@ bool CppParser::match(uint t)
bool CppParser::matchString(QString *s)
{
- bool matches = (yyTok == Tok_String);
+ bool matches = false;
s->clear();
- while (yyTok == Tok_String) {
+ forever {
+ while (yyTok == Tok_Comment)
+ yyTok = getToken();
+ if (yyTok != Tok_String)
+ return matches;
+ matches = true;
*s += yyWord;
s->detach();
- do {
- yyTok = getToken();
- } while (yyTok == Tok_Comment);
+ yyTok = getToken();
}
- return matches;
}
bool CppParser::matchEncoding(bool *utf8)