[2/2] msi: Make sure to reset the 'in_quotes' state in all cases.

Dmitry Timoshkov dmitry at baikal.ru
Tue Nov 3 04:09:00 CST 2015


This patch should properly fix parsing of tokens with embeded double quotes.

Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
---
 dlls/msi/action.c        | 7 +++----
 dlls/msi/tests/install.c | 9 ++++++---
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 16c633b..ac006df 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -255,8 +255,7 @@ static int parse_prop( const WCHAR *str, WCHAR *value, int *quotes )
                 len++;
                 break;
             default:
-                if (!count) in_quotes = FALSE;
-                else in_quotes = TRUE;
+                if (count) in_quotes = TRUE;
                 len++;
                 break;
             }
@@ -277,8 +276,7 @@ static int parse_prop( const WCHAR *str, WCHAR *value, int *quotes )
                 break;
             default:
                 state = state_token;
-                if (!count) in_quotes = FALSE;
-                else in_quotes = TRUE;
+                if (count) in_quotes = TRUE;
                 len++;
                 break;
             }
@@ -287,6 +285,7 @@ static int parse_prop( const WCHAR *str, WCHAR *value, int *quotes )
         default: break;
         }
         if (!ignore) *out++ = *p;
+        if (!count) in_quotes = FALSE;
     }
 
 done:
diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c
index 6b86cd2..9cd579b 100644
--- a/dlls/msi/tests/install.c
+++ b/dlls/msi/tests/install.c
@@ -4716,11 +4716,14 @@ static void test_propcase(void)
     ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
     ok(delete_pf("msitest", FALSE), "Directory not created\n");
 
-    r = MsiInstallProductA(msifile, "BLAHBLAH=\"Copyright \"\"My Company\"\" 2015\" MyProp=42");
+    r = MsiInstallProductA(msifile, "Prop1=\"Copyright \"\"My Company\"\" 2015\" MyProp=42");
+    ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
+    ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
+    ok(delete_pf("msitest", FALSE), "Directory not created\n");
+
+    r = MsiInstallProductA(msifile, "Prop1=\"\"\"install.exe\"\" /Install\" 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:
-- 
2.6.2




More information about the wine-patches mailing list