Hans Leidekker : msi: Fix parsing of an empty property followed by a non-empty property.

Alexandre Julliard julliard at winehq.org
Tue Apr 5 11:23:31 CDT 2011


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

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Tue Apr  5 12:03:36 2011 +0200

msi: Fix parsing of an empty property followed by a non-empty property.

---

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

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 79d12d6..366d897 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -231,6 +231,7 @@ static int parse_prop( const WCHAR *str, WCHAR *value, int *quotes )
                 if (!count) goto done;
                 in_quotes = 1;
                 ignore = 1;
+                len++;
                 break;
             case '"':
                 state = state_quote;
@@ -258,6 +259,7 @@ static int parse_prop( const WCHAR *str, WCHAR *value, int *quotes )
                 state = state_whitespace;
                 if (!count) goto done;
                 in_quotes = 1;
+                len++;
                 break;
             default:
                 if (!count) in_quotes = 0;
@@ -276,8 +278,9 @@ static int parse_prop( const WCHAR *str, WCHAR *value, int *quotes )
                 break;
             case ' ':
                 state = state_whitespace;
-                if (!count) goto done;
+                if (!count || (count > 1 && !len)) goto done;
                 in_quotes = 1;
+                len++;
                 break;
             default:
                 state = state_token;
diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c
index 1f5ab9c..d54f923 100644
--- a/dlls/msi/tests/install.c
+++ b/dlls/msi/tests/install.c
@@ -6346,6 +6346,10 @@ static void test_command_line_parsing(void)
     r = MsiInstallProductA(msifile, cmd);
     ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
 
+    cmd = "Q=\"\" P=\"one\"";
+    r = MsiInstallProductA(msifile, cmd);
+    ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
+
     DeleteFile(msifile);
     RemoveDirectory("msitest");
 }




More information about the wine-cvs mailing list