msi: Handle escaped double quotes in command line parsing.
This commit is contained in:
parent
2cbeb20d39
commit
b32c643c18
|
@ -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 ' ':
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue