https://git.reactos.org/?p=reactos.git;a=commitdiff;h=690643fc77728ca84dec9…
commit 690643fc77728ca84dec9d1271a1a02fc1881792
Author: Doug Lyons <douglyons(a)douglyons.com>
AuthorDate: Mon Jan 20 19:10:04 2025 -0600
Commit: GitHub <noreply(a)github.com>
CommitDate: Mon Jan 20 19:10:04 2025 -0600
[SHELL32] SHELL_FindExecutable: Fix last regression from PR#7588 (#7643)
Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
Co-authored-by: Stanislav Motylkov <x86corez(a)gmail.com>
---
dll/win32/shell32/shlexec.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/dll/win32/shell32/shlexec.cpp b/dll/win32/shell32/shlexec.cpp
index b6bb1f3b224..371f6ad44eb 100644
--- a/dll/win32/shell32/shlexec.cpp
+++ b/dll/win32/shell32/shlexec.cpp
@@ -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 */
}