MSI: Make Sure Paths End With A Slash Before Concatenating File Names

Robert Shearman rob at codeweavers.com
Fri Sep 17 07:39:42 CDT 2004


Changelog:
Make sure paths end with a slash before concatenating file names.
-------------- next part --------------
Index: wine/dlls/msi/action.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/action.c,v
retrieving revision 1.35
diff -u -p -r1.35 action.c
--- wine/dlls/msi/action.c	10 Sep 2004 22:29:49 -0000	1.35
+++ wine/dlls/msi/action.c	17 Sep 2004 12:35:32 -0000
@@ -1965,12 +1965,17 @@ static UINT resolve_folder(MSIPACKAGE *p
 
     if (package->folders[i].ParentIndex >= 0)
     {
+        int len;
         TRACE(" ! Parent is %s\n", debugstr_w(package->folders[
                    package->folders[i].ParentIndex].Directory));
         resolve_folder(package, package->folders[
                        package->folders[i].ParentIndex].Directory, path,source,
                        set_prop, NULL);
 
+        len = strlenW(path);
+        if (len && path[len-1] != '\\')
+            strcatW(path, cszbs);
+
         if (!source)
         {
             if (package->folders[i].TargetDefault[0])
@@ -2072,9 +2077,14 @@ static UINT ACTION_CostFinalize(MSIPACKA
 
         if (comp)
         {
+            int len;
             /* calculate target */
             resolve_folder(package, comp->Directory, file->TargetPath, FALSE,
                        FALSE, NULL);
+            /* make sure that the path ends in a \ */
+            len = strlenW(file->TargetPath);
+            if (len && file->TargetPath[len-1] != '\\')
+                strcatW(file->TargetPath, cszbs);
             strcatW(file->TargetPath,file->FileName);
 
             TRACE("file %s resolves to %s\n",


More information about the wine-patches mailing list