msi: Cast-qual warning fix.

This commit is contained in:
Andrew Talbot 2007-07-23 18:53:19 +01:00 committed by Alexandre Julliard
parent 94e08ec5be
commit 0e14c29d66
1 changed files with 7 additions and 4 deletions

View File

@ -630,22 +630,26 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath,
if (szPackagePath) if (szPackagePath)
{ {
LPWSTR p, check, dir; LPWSTR p, check, dir;
LPCWSTR file;
dir = strdupW(szPackagePath); dir = strdupW(szPackagePath);
p = strrchrW(dir, '\\'); p = strrchrW(dir, '\\');
if (p) if (p)
{
*(++p) = 0; *(++p) = 0;
file = szPackagePath + (p - dir);
}
else else
{ {
msi_free(dir); msi_free(dir);
dir = msi_alloc(MAX_PATH*sizeof(WCHAR)); dir = msi_alloc(MAX_PATH*sizeof(WCHAR));
GetCurrentDirectoryW(MAX_PATH, dir); GetCurrentDirectoryW(MAX_PATH, dir);
lstrcatW(dir, cszbs); lstrcatW(dir, cszbs);
p = (LPWSTR)szPackagePath; file = szPackagePath;
} }
msi_free( package->PackagePath ); msi_free( package->PackagePath );
package->PackagePath = msi_alloc((lstrlenW(dir) + lstrlenW(p) + 2) * sizeof(WCHAR)); package->PackagePath = msi_alloc((lstrlenW(dir) + lstrlenW(file) + 1) * sizeof(WCHAR));
if (!package->PackagePath) if (!package->PackagePath)
{ {
msi_free(dir); msi_free(dir);
@ -653,8 +657,7 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath,
} }
lstrcpyW(package->PackagePath, dir); lstrcpyW(package->PackagePath, dir);
lstrcatW(package->PackagePath, cszbs); lstrcatW(package->PackagePath, file);
lstrcatW(package->PackagePath, p);
check = msi_dup_property( package, cszSourceDir ); check = msi_dup_property( package, cszSourceDir );
if (!check) if (!check)