James Hawkins : msi: Append a backslash to the AppSearch directory path.

Alexandre Julliard julliard at winehq.org
Thu Oct 16 06:07:11 CDT 2008


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

Author: James Hawkins <jhawkins at codeweavers.com>
Date:   Thu Oct 16 01:08:45 2008 -0500

msi: Append a backslash to the AppSearch directory path.

---

 dlls/msi/appsearch.c     |   26 ++++++++++++--------------
 dlls/msi/tests/package.c |   10 ++--------
 2 files changed, 14 insertions(+), 22 deletions(-)

diff --git a/dlls/msi/appsearch.c b/dlls/msi/appsearch.c
index 70bf13a..71ac3cf 100644
--- a/dlls/msi/appsearch.c
+++ b/dlls/msi/appsearch.c
@@ -799,10 +799,12 @@ static UINT ACTION_AppSearchDr(MSIPACKAGE *package, LPWSTR *appValue, MSISIGNATU
         'D','r','L','o','c','a','t','o','r',' ',
         'w','h','e','r','e',' ',
         'S','i','g','n','a','t','u','r','e','_',' ','=',' ', '\'','%','s','\'',0};
-    LPWSTR parentName = NULL, path = NULL, parent = NULL;
+    LPWSTR parentName = NULL, parent = NULL;
+    WCHAR path[MAX_PATH];
     WCHAR expanded[MAX_PATH];
     MSIRECORD *row;
     int depth;
+    DWORD sz;
     UINT rc;
 
     TRACE("%s\n", debugstr_w(sig->Name));
@@ -829,33 +831,29 @@ static UINT ACTION_AppSearchDr(MSIPACKAGE *package, LPWSTR *appValue, MSISIGNATU
         ACTION_FreeSignature(&parentSig);
         msi_free(parentName);
     }
-    /* now look for path */
-    path = msi_dup_record_field(row,3);
+
+    sz = MAX_PATH;
+    MSI_RecordGetStringW(row, 3, path, &sz);
+
     if (MSI_RecordIsNull(row,4))
         depth = 0;
     else
         depth = MSI_RecordGetInteger(row,4);
+
     ACTION_ExpandAnyPath(package, path, expanded, MAX_PATH);
-    msi_free(path);
+
     if (parent)
     {
-        path = msi_alloc((strlenW(parent) + strlenW(expanded) + 1) * sizeof(WCHAR));
-        if (!path)
-        {
-            rc = ERROR_OUTOFMEMORY;
-            goto end;
-        }
         strcpyW(path, parent);
         strcatW(path, expanded);
     }
     else
-        path = expanded;
+        strcpyW(path, expanded);
+
+    PathAddBackslashW(path);
 
     rc = ACTION_SearchDirectory(package, sig, path, depth, appValue);
 
-end:
-    if (path != expanded)
-        msi_free(path);
     msi_free(parent);
     msiobj_release(&row->hdr);
 
diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c
index 581ffd5..6bb68dc 100644
--- a/dlls/msi/tests/package.c
+++ b/dlls/msi/tests/package.c
@@ -6783,19 +6783,13 @@ static void test_appsearch_drlocator(void)
     sprintf(path, "%s\\", CURR_DIR);
     r = MsiGetPropertyA(hpkg, "SIGPROP2", 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\\", CURR_DIR);
     r = MsiGetPropertyA(hpkg, "SIGPROP3", 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;
     r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);




More information about the wine-cvs mailing list