summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qmake/library/qmakeevaluator.cpp13
-rw-r--r--tests/auto/tools/qmake/testdata/functions/functions.pro2
-rw-r--r--tests/auto/tools/qmake/testdata/functions/textfile1
3 files changed, 11 insertions, 5 deletions
diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp
index 01f008c3cf..09ea231684 100644
--- a/qmake/library/qmakeevaluator.cpp
+++ b/qmake/library/qmakeevaluator.cpp
@@ -276,6 +276,8 @@ ProStringList QMakeEvaluator::split_value_list(const QString &vals, const ProFil
ushort unicode = vals_data[x].unicode();
if (unicode == quote) {
quote = 0;
+ hadWord = true;
+ build += QChar(unicode);
continue;
}
switch (unicode) {
@@ -283,7 +285,7 @@ ProStringList QMakeEvaluator::split_value_list(const QString &vals, const ProFil
case '\'':
quote = unicode;
hadWord = true;
- continue;
+ break;
case ' ':
case '\t':
if (!quote) {
@@ -294,22 +296,23 @@ ProStringList QMakeEvaluator::split_value_list(const QString &vals, const ProFil
}
continue;
}
- build += QChar(unicode);
break;
case '\\':
if (x + 1 != vals_len) {
ushort next = vals_data[++x].unicode();
- if (next == '\'' || next == '"' || next == '\\')
+ if (next == '\'' || next == '"' || next == '\\') {
+ build += QChar(unicode);
unicode = next;
- else
+ } else {
--x;
+ }
}
// fallthrough
default:
hadWord = true;
- build += QChar(unicode);
break;
}
+ build += QChar(unicode);
}
if (hadWord)
ret << ProString(build).setSource(source);
diff --git a/tests/auto/tools/qmake/testdata/functions/functions.pro b/tests/auto/tools/qmake/testdata/functions/functions.pro
index c9e7630c85..84f97c2022 100644
--- a/tests/auto/tools/qmake/testdata/functions/functions.pro
+++ b/tests/auto/tools/qmake/testdata/functions/functions.pro
@@ -171,3 +171,5 @@ else: \
testReplace($$shell_quote($$in), $$out, "shell_quote")
testReplace($$reverse($$list(one two three)), three two one, "reverse")
+
+testReplace($$cat(textfile), hi '"holla he"' 'hu!')
diff --git a/tests/auto/tools/qmake/testdata/functions/textfile b/tests/auto/tools/qmake/testdata/functions/textfile
new file mode 100644
index 0000000000..a8248ed6f8
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/functions/textfile
@@ -0,0 +1 @@
+hi "holla he" hu!