James Hawkins : msi: Strip the file off the parent path if it' s not a directory.

Alexandre Julliard julliard at winehq.org
Mon Oct 20 08:00:57 CDT 2008


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

Author: James Hawkins <jhawkins at codeweavers.com>
Date:   Mon Oct 20 04:20:37 2008 -0500

msi: Strip the file off the parent path if it's not a directory.

---

 dlls/msi/appsearch.c     |    6 ++++++
 dlls/msi/tests/package.c |    5 +----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/dlls/msi/appsearch.c b/dlls/msi/appsearch.c
index 74d072f..163ddf8 100644
--- a/dlls/msi/appsearch.c
+++ b/dlls/msi/appsearch.c
@@ -964,6 +964,12 @@ static UINT ACTION_AppSearchDr(MSIPACKAGE *package, LPWSTR *appValue, MSISIGNATU
 
     if (parent)
     {
+        if (!(GetFileAttributesW(parent) & FILE_ATTRIBUTE_DIRECTORY))
+        {
+            PathRemoveFileSpecW(parent);
+            PathAddBackslashW(parent);
+        }
+
         strcpyW(path, parent);
         strcatW(path, expanded);
     }
diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c
index 9911bd1..cc2b04a 100644
--- a/dlls/msi/tests/package.c
+++ b/dlls/msi/tests/package.c
@@ -7169,10 +7169,7 @@ static void test_appsearch_drlocator(void)
     sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);
     r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
     ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
-    todo_wine
-    {
-        ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
-    }
+    ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
 
     size = MAX_PATH;
     sprintf(path, "%s\\FileName3.dll", CURR_DIR);




More information about the wine-cvs mailing list