Hans Leidekker : msi: Handle escaped double quotes in command line parsing.
Alexandre Julliard
julliard at winehq.org
Fri Jul 1 14:11:03 CDT 2011
Module: wine
Branch: master
Commit: b32c643c183d4e132a2a7018ef996d552b6bf0c7
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b32c643c183d4e132a2a7018ef996d552b6bf0c7
Author: Hans Leidekker <hans at codeweavers.com>
Date: Thu Jun 30 12:14:26 2011 +0200
msi: Handle escaped double quotes in command line parsing.
---
dlls/msi/action.c | 4 ++--
dlls/msi/tests/install.c | 12 ++++++++++++
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 01df974..8fe1221 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -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 ' ':
diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c
index f93cc48..1c550ae 100644
--- a/dlls/msi/tests/install.c
+++ b/dlls/msi/tests/install.c
@@ -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");
}
More information about the wine-cvs
mailing list