summaryrefslogtreecommitdiffstats
path: root/qmake/project.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2011-01-24 20:28:56 +0100
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2011-01-25 20:29:01 +0100
commit7052bcc0c6da28f9554f560fef36a5ae3d1e26fd (patch)
tree39a7c3a07db6aa1b0201cf7b108ffd2e5b8ac121 /qmake/project.cpp
parentac798c5d77c59ea8dfe29c9d1896fb6604e3a628 (diff)
remove the completely insane quote nesting from split_value_list()
"foo 'bar "whee"' baz" would be actually treated like nested quotes. of course, this makes utterly no sense, as both the layers below and above couldn't do anything with that. and it would break actually useful things like quoting an apostrophe. Reviewed-by: mariusSO
Diffstat (limited to 'qmake/project.cpp')
-rw-r--r--qmake/project.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/qmake/project.cpp b/qmake/project.cpp
index f314b8b777..cbe3a94050 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -287,7 +287,7 @@ static QStringList split_value_list(const QString &vals)
{
QString build;
QStringList ret;
- QStack<char> quote;
+ ushort quote = 0;
const ushort LPAREN = '(';
const ushort RPAREN = ')';
@@ -303,17 +303,17 @@ static QStringList split_value_list(const QString &vals)
if(x != (int)vals_len-1 && unicode == BACKSLASH &&
(vals_data[x+1].unicode() == SINGLEQUOTE || vals_data[x+1].unicode() == DOUBLEQUOTE)) {
build += vals_data[x++]; //get that 'escape'
- } else if(!quote.isEmpty() && unicode == quote.top()) {
- quote.pop();
- } else if(unicode == SINGLEQUOTE || unicode == DOUBLEQUOTE) {
- quote.push(unicode);
+ } else if(quote && unicode == quote) {
+ quote = 0;
+ } else if(!quote && (unicode == SINGLEQUOTE || unicode == DOUBLEQUOTE)) {
+ quote = unicode;
} else if(unicode == RPAREN) {
--parens;
} else if(unicode == LPAREN) {
++parens;
}
- if(!parens && quote.isEmpty() && (vals_data[x] == Option::field_sep)) {
+ if(!parens && !quote && (vals_data[x] == Option::field_sep)) {
ret << build;
build.clear();
} else {