From 648dbc62e9c4e3fc15613c86bbf3c33029d56366 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 25 Jan 2011 13:59:20 +0100 Subject: 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 --- qmake/project.cpp | 12 ++++++++---- 1 file 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; -- cgit v0.12