diff options
-rw-r--r-- | qmake/generators/makefiledeps.cpp | 11 | ||||
-rw-r--r-- | tests/auto/tools/qmake/testdata/findDeps/main.cpp | 3 |
2 files changed, 7 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; } diff --git a/tests/auto/tools/qmake/testdata/findDeps/main.cpp b/tests/auto/tools/qmake/testdata/findDeps/main.cpp index 0df3f9b7c3..d5dd5b81d3 100644 --- a/tests/auto/tools/qmake/testdata/findDeps/main.cpp +++ b/tests/auto/tools/qmake/testdata/findDeps/main.cpp @@ -35,6 +35,9 @@ / #include "needed.cpp" // if not ignored, symbol needed() won't be available ... +// Check we're not confused by string juxtaposition: +static const char text[] = "lorem ""ipsum /*"; + #include <moc_object1.cpp> /**/ #include <moc_object2.cpp> /**//**/ #include <moc_object3.cpp> |