Skip to content

Commit 16c0308

Browse files
mark987j6t
authored andcommitted
gitk: limit PATH search to bare executable names
The path search overrides used by gitk on Windows are applied to any executable whose name is not 'absolute', meaning that [exec foo/bar ...] will search each element of $PATH to find one with subdirectory foo containing bar. But, per POSIX, and Tcl implementation on all platforms, foo/bar is taken as $(pwd)/foo/bar, and is not searched on $PATH. Fix this descrepency using the same approach applied to git-gui in commit 3f71c97. The key is that the executable name must have no path component, indicated by [file split $exename] having array length 1. Signed-off-by: Mark Levedahl <[email protected]> Signed-off-by: Johannes Sixt <[email protected]>
1 parent 74571bf commit 16c0308

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gitk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ if {[is_Windows]} {
5858
set i $from_index
5959
while {$i < [llength $command_line]} {
6060
set cmd [lindex $command_line $i]
61-
if {[file pathtype $cmd] ne "absolute"} {
61+
if {[llength [file split $cmd]] < 2} {
6262
set fullpath [_which $cmd]
6363
if {$fullpath eq ""} {
6464
throw {NOT-FOUND} "$cmd not found in PATH"

0 commit comments

Comments
 (0)