Commit 4aca381f authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

msi: Only append a backslash to directories.

parent 7497f1ab
......@@ -837,6 +837,7 @@ static UINT ACTION_SearchDirectory(MSIPACKAGE *package, MSISIGNATURE *sig,
LPCWSTR path, int depth, LPWSTR *appValue)
{
UINT rc;
DWORD attr;
LPWSTR val = NULL;
TRACE("%p, %p, %s, %d, %p\n", package, sig, debugstr_w(path), depth,
......@@ -881,7 +882,9 @@ static UINT ACTION_SearchDirectory(MSIPACKAGE *package, MSISIGNATURE *sig,
}
}
if (val && val[lstrlenW(val) - 1] != '\\')
attr = GetFileAttributesW(val);
if ((attr & FILE_ATTRIBUTE_DIRECTORY) &&
val && val[lstrlenW(val) - 1] != '\\')
{
val = msi_realloc(val, (lstrlenW(val) + 2) * sizeof(WCHAR));
if (!val)
......
......@@ -7135,10 +7135,7 @@ static void test_appsearch_drlocator(void)
sprintf(path, "%s\\FileName1", CURR_DIR);
r = MsiGetPropertyA(hpkg, "SIGPROP1", 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);
......@@ -7187,10 +7184,7 @@ static void test_appsearch_drlocator(void)
sprintf(path, "%s\\FileName3.dll", CURR_DIR);
r = MsiGetPropertyA(hpkg, "SIGPROP8", 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, "SIGPROP9", prop, &size);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment