micro-cleanup: exit directly upon unexpected eof
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>
Wed, 31 Jul 2013 14:21:51 +0000 (16:21 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 6 Aug 2013 07:30:26 +0000 (09:30 +0200)
there is not much point in going on.

Change-Id: Ic278941c4b8bbce4ccd93ab92628ab98c2ab3ae2
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
src/linguist/lupdate/cpp.cpp

index 794b865..30c12f4 100644 (file)
@@ -1711,7 +1711,9 @@ void CppParser::parseInternal(ConversionData &cd, const QStringList &includeStac
                     // a '::' token here.
                     do {
                         yyTok = getToken();
-                    } while (yyTok != Tok_LeftBrace && yyTok != Tok_Eof);
+                        if (yyTok == Tok_Eof)
+                            goto goteof;
+                    } while (yyTok != Tok_LeftBrace);
                 } else {
                     if (yyTok != Tok_LeftBrace) {
                         // Obviously a forward declaration. We skip those, as they
@@ -2198,6 +2200,7 @@ void CppParser::parseInternal(ConversionData &cd, const QStringList &includeStac
         }
     }
 
+  goteof:
     if (yyBraceDepth != 0)
         yyMsg(yyBraceLineNo)
             << qPrintable(LU::tr("Unbalanced opening brace in C++ code"