summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@theqtcompany.com>2015-11-18 14:29:19 +0100
committerEdward Welbourne <edward.welbourne@theqtcompany.com>2015-12-11 13:50:58 +0000
commit8fd05e6289a3190a9e1e5056ecff2a0e02aac2c2 (patch)
tree36a8af14d078ab5123946a68ae6c957f0893e4e0 /qmake
parentfda85b6d570702950e85d343745606c35ee02961 (diff)
Don't ignore first character after a string.
The parser in QMakeSourceFileInfo::findDeps() would step over the closing quote of a string, only to have a for loop then step over the character just after that closing quote, which was thus never studied; this could lead to problems in various ways. Fixed that and expanded findDeps() test to catch regressions. Task-number: QTBUG-17533 Change-Id: I7dec5222e38fa188495b39376ffee70bc7bbc87f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/makefiledeps.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/qmake/generators/makefiledeps.cpp b/qmake/generators/makefiledeps.cpp
index b939a9c9d4..43f368f0be 100644
--- a/qmake/generators/makefiledeps.cpp
+++ b/qmake/generators/makefiledeps.cpp
@@ -584,17 +584,14 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
// buffer[x] is '"'
} else {
const char term = buffer[x];
- while (++x < buffer_len) {
- if (buffer[x] == term) {
+ while (++x < buffer_len && buffer[x] != term) {
+ if (buffer[x] == '\\')
++x;
- break;
- } else if (buffer[x] == '\\') {
- ++x;
- } else if (qmake_endOfLine(buffer[x])) {
+ else if (qmake_endOfLine(buffer[x]))
++line_count;
- }
}
}
+ // for loop's ++x shall step over the closing quote.
}
beginning = 0;
}