Dmitry Timoshkov : msi: Correctly parse double quotes in the token value.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Oct 6 09:44:00 CDT 2015


Module: wine
Branch: master
Commit: 42caac841e1755570ba25c2ce95948fc28f31372
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=42caac841e1755570ba25c2ce95948fc28f31372

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Tue Oct  6 18:10:35 2015 +0800

msi: Correctly parse double quotes in the token value.

This fixes an installer that passes to InstallProduct a command line like
PROPERTY1="Installing ""Product name"" version 8.0" PROPERTY2=1 PROPERTY3=1
In this case properties PROPERTY2 and PROPERTY3 were not recognized and that
led to an installation failure when a custom action didn't see them as set.

Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>

---

 dlls/msi/action.c        | 4 ++--
 dlls/msi/tests/install.c | 2 --
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 16c633b..f2e8e71 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -245,7 +245,7 @@ static int parse_prop( const WCHAR *str, WCHAR *value, int *quotes )
             {
             case '"':
                 state = state_quote;
-                if (in_quotes) count--;
+                if (in_quotes && p[1] != '\"') count--;
                 else count++;
                 break;
             case ' ':
@@ -329,7 +329,7 @@ UINT msi_parse_command_line( MSIPACKAGE *package, LPCWSTR szCommandLine,
 
         ptr2 = strchrW( ptr, '=' );
         if (!ptr2) return ERROR_INVALID_COMMAND_LINE;
- 
+
         len = ptr2 - ptr;
         if (!len) return ERROR_INVALID_COMMAND_LINE;
 
diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c
index 6b86cd2..df6fe9c 100644
--- a/dlls/msi/tests/install.c
+++ b/dlls/msi/tests/install.c
@@ -4718,9 +4718,7 @@ static void test_propcase(void)
 
     r = MsiInstallProductA(msifile, "BLAHBLAH=\"Copyright \"\"My Company\"\" 2015\" MyProp=42");
     ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
-todo_wine
     ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
-todo_wine
     ok(delete_pf("msitest", FALSE), "Directory not created\n");
 
 error:




More information about the wine-cvs mailing list