mirror of
https://github.com/reactos/reactos.git
synced 2024-10-05 08:54:40 +00:00
[SYSSETUP]
Fix broken logic in CreateShortcut() and add an explicit overall svn path=/trunk/; revision=53774
This commit is contained in:
parent
02a5aea62f
commit
faff2536ea
|
@ -153,20 +153,21 @@ CreateShortcut(int csidl, LPCTSTR folder, UINT nIdName, LPCTSTR command, UINT nI
|
|||
&lpFilePart);
|
||||
if (dwLen != 0 && dwLen <= sizeof(szWorkingDir) / sizeof(szWorkingDir[0]))
|
||||
{
|
||||
/* Since those should only be called with (.exe) files,
|
||||
lpFilePart has not to be NULL */
|
||||
ASSERT(lpFilePart != NULL);
|
||||
|
||||
/* Save the file name */
|
||||
_tcscpy(exeName, lpFilePart);
|
||||
|
||||
if (lpFilePart != NULL)
|
||||
/* We're only interested in the path. Cut the file name off.
|
||||
Also remove the trailing backslash unless the working directory
|
||||
is only going to be a drive, ie. C:\ */
|
||||
*(lpFilePart--) = _T('\0');
|
||||
if (!(lpFilePart - szWorkingDir == 2 && szWorkingDir[1] == _T(':') &&
|
||||
szWorkingDir[2] == _T('\\')))
|
||||
{
|
||||
/* We're only interested in the path. Cut the file name off.
|
||||
Also remove the trailing backslash unless the working directory
|
||||
is only going to be a drive, ie. C:\ */
|
||||
*(lpFilePart--) = _T('\0');
|
||||
if (!(lpFilePart - szWorkingDir == 2 && szWorkingDir[1] == _T(':') &&
|
||||
szWorkingDir[2] == _T('\\')))
|
||||
{
|
||||
*lpFilePart = _T('\0');
|
||||
}
|
||||
*lpFilePart = _T('\0');
|
||||
}
|
||||
|
||||
lpWorkingDir = szWorkingDir;
|
||||
|
|
Loading…
Reference in a new issue