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

This commit is contained in:
Robert Shearman 2004-09-17 18:11:14 +00:00 committed by Alexandre Julliard
parent 8a8ee786ee
commit dce07c4040
1 changed files with 10 additions and 0 deletions

View File

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