make split_value_list() even less sane again
contrary to what one may expect, it's actually *not* supposed to remove the meta-characters it interprets. luckily, this function is not used much any more ... Task-number: QTBUG-31877 Change-Id: I2b60f9b173140da78db2b07b596cc2e5f6e6d555 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
parent
bc328f8ec3
commit
783181cfc1
@ -276,6 +276,8 @@ ProStringList QMakeEvaluator::split_value_list(const QString &vals, const ProFil
|
|||||||
ushort unicode = vals_data[x].unicode();
|
ushort unicode = vals_data[x].unicode();
|
||||||
if (unicode == quote) {
|
if (unicode == quote) {
|
||||||
quote = 0;
|
quote = 0;
|
||||||
|
hadWord = true;
|
||||||
|
build += QChar(unicode);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
switch (unicode) {
|
switch (unicode) {
|
||||||
@ -283,7 +285,7 @@ ProStringList QMakeEvaluator::split_value_list(const QString &vals, const ProFil
|
|||||||
case '\'':
|
case '\'':
|
||||||
quote = unicode;
|
quote = unicode;
|
||||||
hadWord = true;
|
hadWord = true;
|
||||||
continue;
|
break;
|
||||||
case ' ':
|
case ' ':
|
||||||
case '\t':
|
case '\t':
|
||||||
if (!quote) {
|
if (!quote) {
|
||||||
@ -294,22 +296,23 @@ ProStringList QMakeEvaluator::split_value_list(const QString &vals, const ProFil
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
build += QChar(unicode);
|
|
||||||
break;
|
break;
|
||||||
case '\\':
|
case '\\':
|
||||||
if (x + 1 != vals_len) {
|
if (x + 1 != vals_len) {
|
||||||
ushort next = vals_data[++x].unicode();
|
ushort next = vals_data[++x].unicode();
|
||||||
if (next == '\'' || next == '"' || next == '\\')
|
if (next == '\'' || next == '"' || next == '\\') {
|
||||||
|
build += QChar(unicode);
|
||||||
unicode = next;
|
unicode = next;
|
||||||
else
|
} else {
|
||||||
--x;
|
--x;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// fallthrough
|
// fallthrough
|
||||||
default:
|
default:
|
||||||
hadWord = true;
|
hadWord = true;
|
||||||
build += QChar(unicode);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
build += QChar(unicode);
|
||||||
}
|
}
|
||||||
if (hadWord)
|
if (hadWord)
|
||||||
ret << ProString(build).setSource(source);
|
ret << ProString(build).setSource(source);
|
||||||
|
@ -171,3 +171,5 @@ else: \
|
|||||||
testReplace($$shell_quote($$in), $$out, "shell_quote")
|
testReplace($$shell_quote($$in), $$out, "shell_quote")
|
||||||
|
|
||||||
testReplace($$reverse($$list(one two three)), three two one, "reverse")
|
testReplace($$reverse($$list(one two three)), three two one, "reverse")
|
||||||
|
|
||||||
|
testReplace($$cat(textfile), hi '"holla he"' 'hu!')
|
||||||
|
1
tests/auto/tools/qmake/testdata/functions/textfile
vendored
Normal file
1
tests/auto/tools/qmake/testdata/functions/textfile
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
hi "holla he" hu!
|
Loading…
x
Reference in New Issue
Block a user