Commit dce07c40 authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

Make sure paths end with a slash before concatenating file names.

parent 8a8ee786
...@@ -1965,12 +1965,17 @@ static UINT resolve_folder(MSIPACKAGE *package, LPCWSTR name, LPWSTR path, ...@@ -1965,12 +1965,17 @@ static UINT resolve_folder(MSIPACKAGE *package, LPCWSTR name, LPWSTR path,
if (package->folders[i].ParentIndex >= 0) if (package->folders[i].ParentIndex >= 0)
{ {
int len;
TRACE(" ! Parent is %s\n", debugstr_w(package->folders[ TRACE(" ! Parent is %s\n", debugstr_w(package->folders[
package->folders[i].ParentIndex].Directory)); package->folders[i].ParentIndex].Directory));
resolve_folder(package, package->folders[ resolve_folder(package, package->folders[
package->folders[i].ParentIndex].Directory, path,source, package->folders[i].ParentIndex].Directory, path,source,
set_prop, NULL); set_prop, NULL);
len = strlenW(path);
if (len && path[len-1] != '\\')
strcatW(path, cszbs);
if (!source) if (!source)
{ {
if (package->folders[i].TargetDefault[0]) if (package->folders[i].TargetDefault[0])
...@@ -2072,9 +2077,14 @@ static UINT ACTION_CostFinalize(MSIPACKAGE *package) ...@@ -2072,9 +2077,14 @@ static UINT ACTION_CostFinalize(MSIPACKAGE *package)
if (comp) if (comp)
{ {
int len;
/* calculate target */ /* calculate target */
resolve_folder(package, comp->Directory, file->TargetPath, FALSE, resolve_folder(package, comp->Directory, file->TargetPath, FALSE,
FALSE, NULL); 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); strcatW(file->TargetPath,file->FileName);
TRACE("file %s resolves to %s\n", TRACE("file %s resolves to %s\n",
......
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