diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2011-01-24 19:28:56 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2011-01-25 19:29:01 (GMT) |
commit | 7052bcc0c6da28f9554f560fef36a5ae3d1e26fd (patch) | |
tree | 39a7c3a07db6aa1b0201cf7b108ffd2e5b8ac121 /qmake | |
parent | ac798c5d77c59ea8dfe29c9d1896fb6604e3a628 (diff) | |
download | Qt-7052bcc0c6da28f9554f560fef36a5ae3d1e26fd.zip Qt-7052bcc0c6da28f9554f560fef36a5ae3d1e26fd.tar.gz Qt-7052bcc0c6da28f9554f560fef36a5ae3d1e26fd.tar.bz2 |
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')
-rw-r--r-- | qmake/project.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/qmake/project.cpp b/qmake/project.cpp index f314b8b..cbe3a94 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 { |