Author: pschweitzer Date: Tue Sep 20 14:21:21 2011 New Revision: 53774
URL: http://svn.reactos.org/svn/reactos?rev=53774&view=rev Log: [SYSSETUP] Fix broken logic in CreateShortcut() and add an explicit overall
Modified: trunk/reactos/dll/win32/syssetup/install.c
Modified: trunk/reactos/dll/win32/syssetup/install.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/install.... ============================================================================== --- trunk/reactos/dll/win32/syssetup/install.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/syssetup/install.c [iso-8859-1] Tue Sep 20 14:21:21 2011 @@ -153,20 +153,21 @@ &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('\'))) - { - *lpFilePart = _T('\0'); - } + /* 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'); }
lpWorkingDir = szWorkingDir;