diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2011-01-25 12:59:20 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2011-01-25 19:37:54 (GMT) |
commit | 648dbc62e9c4e3fc15613c86bbf3c33029d56366 (patch) | |
tree | 70d105eb8735196f46285c69c60cd35d57cdab3c /qmake/project.cpp | |
parent | 005e39a2aab88d47044fa2108a6d04bd490b169e (diff) | |
download | Qt-648dbc62e9c4e3fc15613c86bbf3c33029d56366.zip Qt-648dbc62e9c4e3fc15613c86bbf3c33029d56366.tar.gz Qt-648dbc62e9c4e3fc15613c86bbf3c33029d56366.tar.bz2 |
interpret backslash escaping of quotes in split_arg_list()
split_value_list() interprets them, too, but this is useless if the
higher layer doesn't and is thus confused by unmatched quotes.
note the top-level parsing layer doesn't support escapes, but that's ok,
because there function calls are "isolated" by non-escapable parenthesis
counting (and the RHS of assignments is not subject to any parsing at
all).
Reviewed-by: mariusSO
Diffstat (limited to 'qmake/project.cpp')
-rw-r--r-- | qmake/project.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/qmake/project.cpp b/qmake/project.cpp index 7951d11..88d5962 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -237,6 +237,7 @@ static QStringList split_arg_list(QString params) const ushort RPAREN = ')'; const ushort SINGLEQUOTE = '\''; const ushort DOUBLEQUOTE = '"'; + const ushort BACKSLASH = '\\'; const ushort COMMA = ','; const ushort SPACE = ' '; //const ushort TAB = '\t'; @@ -255,14 +256,17 @@ static QStringList split_arg_list(QString params) return args; } ushort unicode = params_data[x].unicode(); - if(unicode == LPAREN) { - --parens; - } else if(unicode == RPAREN) { - ++parens; + if(x != (int)params_len-1 && unicode == BACKSLASH && + (params_data[x+1].unicode() == SINGLEQUOTE || params_data[x+1].unicode() == DOUBLEQUOTE)) { + x++; //get that 'escape' } 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 && unicode == COMMA) { int prev = last; |