Skip to content

Commit 411cd49

Browse files
mark987ttaylorr
authored andcommitted
git-gui: avoid auto_execok for git-bash menu item
On Windows, git-gui offers to open a git-bash session for the current repository from the menu, but uses [auto_execok start] to get the command to actually run that shell. The code for auto_execok, in /usr/share/tcl8.6/tcl.init, has 'start' in the 'shellBuiltins' list for cmd.exe on Windows: as a result, auto_execok does not actually search for start, meaning this usage is technically ok with auto_execok now. However, leaving this use of auto_execok in place will just induce confusion about why a known unsafe function is being used on Windows. Instead, let's switch to using our known safe _which function that looks only in $PATH, excluding the current working directory. Signed-off-by: Mark Levedahl <[email protected]> Signed-off-by: Johannes Sixt <[email protected]> Signed-off-by: Taylor Blau <[email protected]>
1 parent 2c66188 commit 411cd49

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git-gui.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2769,7 +2769,7 @@ if {[is_Windows]} {
27692769
}
27702770
.mbar.repository add command \
27712771
-label [mc "Git Bash"] \
2772-
-command {eval exec [auto_execok start] $cmdLine}
2772+
-command {eval exec [list [_which cmd] /c start] $cmdLine}
27732773
}
27742774

27752775
if {[is_Windows] || ![is_bare]} {

0 commit comments

Comments
 (0)