summaryrefslogtreecommitdiffstats
path: root/tools/linguist/lupdate/cpp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/linguist/lupdate/cpp.cpp')
-rw-r--r--tools/linguist/lupdate/cpp.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp
index 8de403e..3999b84 100644
--- a/tools/linguist/lupdate/cpp.cpp
+++ b/tools/linguist/lupdate/cpp.cpp
@@ -307,13 +307,12 @@ void CppParser::setInput(QTextStream &ts, const QString &fileName)
uint CppParser::getChar()
{
- int len = yyInStr.size();
const ushort *uc = (const ushort *)yyInStr.unicode();
forever {
- if (yyInPos >= len)
- return EOF;
uint c = uc[yyInPos++];
- if (c == '\\' && yyInPos < len) {
+ if (!c)
+ return EOF;
+ if (c == '\\') {
if (uc[yyInPos] == '\n') {
++yyCurLineNo;
++yyInPos;
@@ -322,13 +321,13 @@ uint CppParser::getChar()
if (uc[yyInPos] == '\r') {
++yyCurLineNo;
++yyInPos;
- if (yyInPos < len && uc[yyInPos] == '\n')
+ if (uc[yyInPos] == '\n')
++yyInPos;
continue;
}
}
if (c == '\r') {
- if (yyInPos < len && uc[yyInPos] == '\n')
+ if (uc[yyInPos] == '\n')
++yyInPos;
c = '\n';
++yyCurLineNo;