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.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp
index 7a616e3d0b..63749122eb 100644
--- a/tools/linguist/lupdate/cpp.cpp
+++ b/tools/linguist/lupdate/cpp.cpp
@@ -1899,25 +1899,25 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions)
case Tok_Comment:
if (!tor)
goto case_default;
- if (yyWord.startsWith(QLatin1Char(':'))) {
- yyWord.remove(0, 1);
+ if (yyWord.at(0) == QLatin1Char(':') && yyWord.at(1).isSpace()) {
+ yyWord.remove(0, 2);
extracomment += yyWord;
extracomment.detach();
- } else if (yyWord.startsWith(QLatin1Char('='))) {
- yyWord.remove(0, 1);
+ } else if (yyWord.at(0) == QLatin1Char('=') && yyWord.at(1).isSpace()) {
+ yyWord.remove(0, 2);
msgid = yyWord.simplified();
msgid.detach();
- } else if (yyWord.startsWith(QLatin1Char('~'))) {
- yyWord.remove(0, 1);
+ } else if (yyWord.at(0) == QLatin1Char('~') && yyWord.at(1).isSpace()) {
+ yyWord.remove(0, 2);
text = yyWord.trimmed();
int k = text.indexOf(QLatin1Char(' '));
if (k > -1)
extra.insert(text.left(k), text.mid(k + 1).trimmed());
text.clear();
- } else if (yyWord.startsWith(QLatin1Char('%'))) {
- sourcetext.reserve(sourcetext.length() + yyWord.length());
+ } else if (yyWord.at(0) == QLatin1Char('%') && yyWord.at(1).isSpace()) {
+ sourcetext.reserve(sourcetext.length() + yyWord.length() - 2);
ushort *ptr = (ushort *)sourcetext.data() + sourcetext.length();
- int p = 1, c;
+ int p = 2, c;
forever {
if (p >= yyWord.length())
break;