Make sure exePath contains the path since it is used later in the

function as well.
This commit is contained in:
Aric Stewart 2004-08-23 17:55:29 +00:00 committed by Alexandre Julliard
parent 9f6f7cc742
commit 383de6efbc
1 changed files with 5 additions and 8 deletions

View File

@ -678,22 +678,19 @@ static HRESULT WINAPI IPersistStream_fnSave(
*exePath = '\0';
if (This->sPath)
SHELL_FindExecutable(NULL, This->sPath, wOpen, exePath, MAX_PATH, NULL, NULL, NULL, NULL);
/* if there's no PIDL, generate one */
if( ! This->pPidl )
{
SHELL_FindExecutable(NULL, This->sPath, wOpen, exePath, MAX_PATH, NULL, NULL, NULL, NULL);
/*
* windows can create lnk files to executables that do not exist yet
* so if the executable does not exist the just trust the path they
* gave us
*/
if( !*exePath )
This->pPidl = ILCreateFromPathW(This->sPath);
else
This->pPidl = ILCreateFromPathW(exePath);
if( !*exePath ) strcpyW(exePath,This->sPath);
}
/* if there's no PIDL, generate one */
if( ! This->pPidl ) This->pPidl = ILCreateFromPathW(exePath);
memset(&header, 0, sizeof(header));
header.dwSize = sizeof(header);
memcpy(&header.MagicGuid, &CLSID_ShellLink, sizeof(header.MagicGuid) );