Hans Leidekker : msi: Accept whitespace-only property values on the command line.

Alexandre Julliard julliard at winehq.org
Wed Mar 30 13:15:40 CDT 2011


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

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Wed Mar 30 12:31:19 2011 +0200

msi: Accept whitespace-only property values on the command line.

---

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

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index abee14c..a5a1e33 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -276,7 +276,7 @@ static int parse_prop( const WCHAR *str, WCHAR *value, int *quotes )
                 break;
             case ' ':
                 state = state_whitespace;
-                if (!count || !len) goto done;
+                if (!count) goto done;
                 in_quotes = 1;
                 break;
             default:
@@ -317,7 +317,7 @@ UINT msi_parse_command_line( MSIPACKAGE *package, LPCWSTR szCommandLine,
                              BOOL preserve_case )
 {
     LPCWSTR ptr, ptr2;
-    int quotes;
+    int num_quotes;
     DWORD len;
     WCHAR *prop, *val;
     UINT r;
@@ -345,10 +345,10 @@ UINT msi_parse_command_line( MSIPACKAGE *package, LPCWSTR szCommandLine,
         ptr2++;
         while (*ptr2 == ' ') ptr2++;
 
-        quotes = 0;
+        num_quotes = 0;
         val = msi_alloc( (strlenW( ptr2 ) + 1) * sizeof(WCHAR) );
-        len = parse_prop( ptr2, val, &quotes );
-        if (quotes % 2)
+        len = parse_prop( ptr2, val, &num_quotes );
+        if (num_quotes % 2)
         {
             WARN("unbalanced quotes\n");
             msi_free( val );
diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c
index 9e8535a..1f5ab9c 100644
--- a/dlls/msi/tests/install.c
+++ b/dlls/msi/tests/install.c
@@ -6282,6 +6282,10 @@ static void test_command_line_parsing(void)
     r = MsiInstallProductA(msifile, cmd);
     ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
 
+    cmd = "P=\"  \"";
+    r = MsiInstallProductA(msifile, cmd);
+    ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
+
     cmd = "P=one";
     r = MsiInstallProductA(msifile, cmd);
     ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);




More information about the wine-cvs mailing list