From 690643fc77728ca84dec9d1271a1a02fc1881792 Mon Sep 17 00:00:00 2001 From: Doug Lyons Date: Mon, 20 Jan 2025 19:10:04 -0600 Subject: [PATCH] [SHELL32] SHELL_FindExecutable: Fix last regression from PR#7588 (#7643) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Hermès Bélusca-Maïto Co-authored-by: Stanislav Motylkov --- 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 */ }