Mike McCormack : msi: Remove a level of indent in resolve_folder().

Alexandre Julliard julliard at wine.codeweavers.com
Fri Nov 17 04:54:15 CST 2006


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

Author: Mike McCormack <mike at codeweavers.com>
Date:   Fri Nov 17 15:15:56 2006 +0900

msi: Remove a level of indent in resolve_folder().

---

 dlls/msi/helpers.c |   87 ++++++++++++++++++++++++++-------------------------
 1 files changed, 44 insertions(+), 43 deletions(-)

diff --git a/dlls/msi/helpers.c b/dlls/msi/helpers.c
index 82f98b6..ebd0301 100644
--- a/dlls/msi/helpers.c
+++ b/dlls/msi/helpers.c
@@ -201,7 +201,7 @@ LPWSTR resolve_folder(MSIPACKAGE *packag
                       BOOL set_prop, MSIFOLDER **folder)
 {
     MSIFOLDER *f;
-    LPWSTR p, path = NULL;
+    LPWSTR p, path = NULL, parent;
 
     TRACE("Working to resolve %s\n",debugstr_w(name));
 
@@ -267,60 +267,61 @@ LPWSTR resolve_folder(MSIPACKAGE *packag
         return path;
     }
 
-    if (f->Parent)
-    {
-        LPWSTR parent = f->Parent->Directory;
+    if (!f->Parent)
+        return path;
 
-        TRACE(" ! Parent is %s\n", debugstr_w(parent));
+    parent = f->Parent->Directory;
 
-        p = resolve_folder(package, parent, source, set_prop, NULL);
-        if (!source)
-        {
-            TRACE("   TargetDefault = %s\n", debugstr_w(f->TargetDefault));
+    TRACE(" ! Parent is %s\n", debugstr_w(parent));
 
-            path = build_directory_name( 3, p, f->TargetDefault, NULL );
-            clean_spaces_from_path( path );
-            f->ResolvedTarget = strdupW( path );
-            TRACE("target -> %s\n", debugstr_w(path));
-            if (set_prop)
-                MSI_SetPropertyW(package,name,path);
-        }
-        else 
-        {
-            /* source may be in a few different places ... check each of them */
-            path = NULL;
+    p = resolve_folder(package, parent, source, set_prop, NULL);
+    if (!source)
+    {
+        TRACE("   TargetDefault = %s\n", debugstr_w(f->TargetDefault));
 
-            /* try the long path directory */
-            if (f->SourceLongPath)
+        path = build_directory_name( 3, p, f->TargetDefault, NULL );
+        clean_spaces_from_path( path );
+        f->ResolvedTarget = strdupW( path );
+        TRACE("target -> %s\n", debugstr_w(path));
+        if (set_prop)
+            MSI_SetPropertyW(package,name,path);
+    }
+    else
+    {
+        /* source may be in a few different places ... check each of them */
+        path = NULL;
+
+        /* try the long path directory */
+        if (f->SourceLongPath)
+        {
+            path = build_directory_name( 3, p, f->SourceLongPath, NULL );
+            if (INVALID_FILE_ATTRIBUTES == GetFileAttributesW( path ))
             {
-                path = build_directory_name( 3, p, f->SourceLongPath, NULL );
-                if (INVALID_FILE_ATTRIBUTES == GetFileAttributesW( path ))
-                {
-                    msi_free( path );
-                    path = NULL;
-                }
+                msi_free( path );
+                path = NULL;
             }
+        }
 
-            /* try the short path directory */
-            if (!path && f->SourceShortPath)
+        /* try the short path directory */
+        if (!path && f->SourceShortPath)
+        {
+            path = build_directory_name( 3, p, f->SourceShortPath, NULL );
+            if (INVALID_FILE_ATTRIBUTES == GetFileAttributesW( path ))
             {
-                path = build_directory_name( 3, p, f->SourceShortPath, NULL );
-                if (INVALID_FILE_ATTRIBUTES == GetFileAttributesW( path ))
-                {
-                    msi_free( path );
-                    path = NULL;
-                }
+                msi_free( path );
+                path = NULL;
             }
+        }
 
-            /* try the root of the install */
-            if (!path)
-                path = get_source_root( package );
+        /* try the root of the install */
+        if (!path)
+            path = get_source_root( package );
 
-            TRACE("source -> %s\n", debugstr_w(path));
-            f->ResolvedSource = strdupW( path );
-        }
-        msi_free(p);
+        TRACE("source -> %s\n", debugstr_w(path));
+        f->ResolvedSource = strdupW( path );
     }
+    msi_free(p);
+
     return path;
 }
 




More information about the wine-cvs mailing list