Slightly older version of master from https://github.com/j6t/gitk

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 3f71c97e. 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 <mlevedahl@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>

authored by

Mark Levedahl and committed by
Johannes Sixt
16c03089 74571bff

+1 -1
+1 -1
gitk
··· 58 58 set i $from_index 59 59 while {$i < [llength $command_line]} { 60 60 set cmd [lindex $command_line $i] 61 - if {[file pathtype $cmd] ne "absolute"} { 61 + if {[llength [file split $cmd]] < 2} { 62 62 set fullpath [_which $cmd] 63 63 if {$fullpath eq ""} { 64 64 throw {NOT-FOUND} "$cmd not found in PATH"