msi: Accept whitespace-only property values on the command line.
authorHans Leidekker <hans@codeweavers.com>
Wed, 30 Mar 2011 10:31:19 +0000 (12:31 +0200)
committerAlexandre Julliard <julliard@winehq.org>
Wed, 30 Mar 2011 11:28:05 +0000 (13:28 +0200)
dlls/msi/action.c
dlls/msi/tests/install.c

index abee14c2a25d21ee2c734304c6226c7f2566eec7..a5a1e336955095449df17b794406015b44612370 100644 (file)
@@ -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 );
index 9e8535a6adfbc75fb6ae7adeb0c3cb288c9c80ec..1f5ab9c690f553fe3d679b4577c6a39313d1d202 100644 (file)
@@ -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);