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;
|
break;
|
||||||
case '"':
|
case '"':
|
||||||
state = state_quote;
|
state = state_quote;
|
||||||
if (in_quotes) count--;
|
if (in_quotes && p[1] != '\"') count--;
|
||||||
else count++;
|
else count++;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -267,7 +267,7 @@ static int parse_prop( const WCHAR *str, WCHAR *value, int *quotes )
|
||||||
switch (*p)
|
switch (*p)
|
||||||
{
|
{
|
||||||
case '"':
|
case '"':
|
||||||
if (in_quotes) count--;
|
if (in_quotes && p[1] != '\"') count--;
|
||||||
else count++;
|
else count++;
|
||||||
break;
|
break;
|
||||||
case ' ':
|
case ' ':
|
||||||
|
|
|
@ -6350,6 +6350,18 @@ static void test_command_line_parsing(void)
|
||||||
r = MsiInstallProductA(msifile, cmd);
|
r = MsiInstallProductA(msifile, cmd);
|
||||||
ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
|
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);
|
DeleteFile(msifile);
|
||||||
RemoveDirectory("msitest");
|
RemoveDirectory("msitest");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue