Hans Leidekker : msi: Reduce filename to the long name in ITERATE_RemoveFiles.

Alexandre Julliard julliard at winehq.org
Mon Mar 7 12:22:45 CST 2011


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

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Mon Mar  7 12:39:53 2011 +0100

msi: Reduce filename to the long name in ITERATE_RemoveFiles.

---

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

diff --git a/dlls/msi/files.c b/dlls/msi/files.c
index d024718..df765e5 100644
--- a/dlls/msi/files.c
+++ b/dlls/msi/files.c
@@ -915,14 +915,14 @@ static UINT ITERATE_RemoveFiles(MSIRECORD *row, LPVOID param)
     MSIPACKAGE *package = param;
     MSICOMPONENT *comp;
     MSIRECORD *uirow;
-    LPCWSTR component, filename, dirprop;
+    LPCWSTR component, dirprop;
     UINT install_mode;
-    LPWSTR dir = NULL, path = NULL;
+    LPWSTR dir = NULL, path = NULL, filename = NULL;
     DWORD size;
     UINT ret = ERROR_SUCCESS;
 
     component = MSI_RecordGetString(row, 2);
-    filename = MSI_RecordGetString(row, 3);
+    filename = strdupW( MSI_RecordGetString(row, 3) );
     dirprop = MSI_RecordGetString(row, 4);
     install_mode = MSI_RecordGetInteger(row, 5);
 
@@ -950,7 +950,12 @@ static UINT ITERATE_RemoveFiles(MSIRECORD *row, LPVOID param)
     if (!dir)
         return ERROR_OUTOFMEMORY;
 
-    size = (filename != NULL) ? lstrlenW(filename) : 0;
+    size = 0;
+    if (filename)
+    {
+        reduce_to_longfilename( filename );
+        size = lstrlenW( filename );
+    }
     size += lstrlenW(dir) + 2;
     path = msi_alloc(size * sizeof(WCHAR));
     if (!path)
@@ -981,6 +986,7 @@ done:
     ui_actiondata( package, szRemoveFiles, uirow );
     msiobj_release( &uirow->hdr );
 
+    msi_free(filename);
     msi_free(path);
     msi_free(dir);
     return ret;




More information about the wine-cvs mailing list