[SHELL32] SHELL_FindExecutable: Fix last regression from PR#7588 (#7643)

Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Co-authored-by: Stanislav Motylkov <x86corez@gmail.com>
This commit is contained in:
Doug Lyons 2025-01-20 19:10:04 -06:00 committed by GitHub
parent 853b8ebd02
commit 690643fc77
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -794,6 +794,14 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb,
TRACE("PathResolveW returned non-zero\n");
lpFile = xlpFile;
PathRemoveBlanksW(xlpFile);
/* Clear any trailing periods */
SIZE_T i = wcslen(xlpFile);
while (i > 0 && xlpFile[i - 1] == '.')
{
xlpFile[--i] = '\0';
}
lstrcpyW(lpResult, xlpFile);
/* The file was found in lpPath or one of the directories in the system-wide search path */
}