msi: Handle escaped double quotes in command line parsing.

This commit is contained in:
Hans Leidekker 2011-06-30 12:14:26 +02:00 committed by Alexandre Julliard
parent 2cbeb20d39
commit b32c643c18
2 changed files with 14 additions and 2 deletions

View File

@ -229,7 +229,7 @@ static int parse_prop( const WCHAR *str, WCHAR *value, int *quotes )
break;
case '"':
state = state_quote;
if (in_quotes) count--;
if (in_quotes && p[1] != '\"') count--;
else count++;
break;
default:
@ -267,7 +267,7 @@ static int parse_prop( const WCHAR *str, WCHAR *value, int *quotes )
switch (*p)
{
case '"':
if (in_quotes) count--;
if (in_quotes && p[1] != '\"') count--;
else count++;
break;
case ' ':

View File

@ -6350,6 +6350,18 @@ static void test_command_line_parsing(void)
r = MsiInstallProductA(msifile, cmd);
ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
cmd = "P=\"\"\"one\"\"\" Q=\"two\"";
r = MsiInstallProductA(msifile, cmd);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
cmd = "P=\"one \"\"two\"\"\" Q=\"three\"";
r = MsiInstallProductA(msifile, cmd);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
cmd = "P=\"\"\"one\"\" two\" Q=\"three\"";
r = MsiInstallProductA(msifile, cmd);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
DeleteFile(msifile);
RemoveDirectory("msitest");
}