Skip to content

Commit 433518e

Browse files
committed
Changes based on reviewer comments.
1 parent 858dec2 commit 433518e

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

dll/win32/shell32/shlexec.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,16 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb,
794794
TRACE("PathResolveW returned non-zero\n");
795795
lpFile = xlpFile;
796796
PathRemoveBlanksW(xlpFile);
797+
798+
/* Clear any trailing periods */
799+
for (SIZE_T i = wcslen(xlpFile); i > 0; i--)
800+
{
801+
if (i > 0 && xlpFile[i - 1] == '.')
802+
xlpFile[i - 1] = '\0';
803+
else
804+
break;
805+
}
806+
797807
lstrcpyW(lpResult, xlpFile);
798808
/* The file was found in lpPath or one of the directories in the system-wide search path */
799809
}
@@ -802,15 +812,6 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb,
802812
xlpFile[0] = '\0';
803813
}
804814

805-
/* Clear any trailing periods */
806-
for (SIZE_T i = wcslen(xlpFile); i > 0; i--)
807-
{
808-
if (i > 0 && xlpFile[i - 1] == '.')
809-
xlpFile[i - 1] = '\0';
810-
else
811-
break;
812-
}
813-
814815
attribs = GetFileAttributesW(lpFile);
815816
if (attribs != INVALID_FILE_ATTRIBUTES && (attribs & FILE_ATTRIBUTE_DIRECTORY))
816817
{

0 commit comments

Comments
 (0)