Hans Leidekker : msi: Put quotes around the filename in MsiApplyPatch.

Alexandre Julliard julliard at winehq.org
Thu Nov 11 12:05:48 CST 2010


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

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Thu Nov 11 10:45:05 2010 +0100

msi: Put quotes around the filename in MsiApplyPatch.

---

 dlls/msi/msi.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c
index 85bdc96..9e2225c 100644
--- a/dlls/msi/msi.c
+++ b/dlls/msi/msi.c
@@ -351,7 +351,7 @@ static UINT MSI_ApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szProductCode, LPCWS
     LPWSTR beg, end, cmd, codes = NULL;
     BOOL succeeded = FALSE;
 
-    static const WCHAR patcheq[] = {'P','A','T','C','H','=',0};
+    static const WCHAR fmt[] = {'%','s',' ','P','A','T','C','H','=','"','%','s','"',0};
     static WCHAR empty[] = {0};
 
     if (!szPatchPackage || !szPatchPackage[0])
@@ -363,18 +363,14 @@ static UINT MSI_ApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szProductCode, LPCWS
     if (!szCommandLine)
         cmd_ptr = empty;
 
-    size = lstrlenW(cmd_ptr) + lstrlenW(patcheq) + lstrlenW(szPatchPackage) + 1;
+    size = strlenW(cmd_ptr) + strlenW(fmt) + strlenW(szPatchPackage) + 1;
     cmd = msi_alloc(size * sizeof(WCHAR));
     if (!cmd)
     {
         msi_free(codes);
         return ERROR_OUTOFMEMORY;
     }
-
-    lstrcpyW(cmd, cmd_ptr);
-    if (szCommandLine) lstrcatW(cmd, szSpace);
-    lstrcatW(cmd, patcheq);
-    lstrcatW(cmd, szPatchPackage);
+    sprintfW(cmd, fmt, cmd_ptr, szPatchPackage);
 
     if (szProductCode)
         r = MsiConfigureProductExW(szProductCode, INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT, cmd);




More information about the wine-cvs mailing list