git-gui: _which, only add .exe suffix if not present
The _which function finds executables on $PATH, and adds .exe on Windows unless -script was given. However, win32.tcl executes "wscript.exe" and "cscript.exe", both of which fail as _which adds .exe to both. This is already fixed in git-gui released by Git for Windows. Do so here. Signed-off-by: Mark Levedahl <mlevedahl@gmail.com> Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Taylor Blau <me@ttaylorr.com>
Mark Levedahl committed
Apr 3, 2025 at 10:26 UTC
37b9230226db2a3a81df2e92a44ea655076cd0c4
1 file changed
+3
git-gui.sh
+3
@@ -101,6 +101,9 @@ proc _which {what args} {
101
102
if {[is_Windows] && [lsearch -exact $args -script] >= 0} {
103
set suffix {}
104
+ } elseif {[is_Windows] && [string match *$_search_exe [string tolower $what]]} {
105
+ # The search string already has the file extension
106
+ set suffix {}
107
} else {
108
set suffix $_search_exe
109
}