diff --git a/Makefile b/Makefile index 197b55edf3eeeaec345d88227825cc550e6de72d..e22ba5c321dc47fdf512f30c5e6c741c41fb99eb 100644 --- a/Makefile +++ b/Makefile @@ -215,6 +215,7 @@ endif $(GITGUI_MAIN): git-gui.sh GIT-VERSION-FILE GIT-GUI-VARS $(QUIET_GEN)rm -f $@ $@+ && \ sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ + -e 's|@@SHELL_PATH@@|$(SHELL_PATH_SQ)|' \ -e '1,30s|^ argv0=$$0| argv0=$(GITGUI_SCRIPT)|' \ -e '1,30s|^ exec wish | exec '\''$(TCLTK_PATH_SED)'\'' |' \ -e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \ diff --git a/git-gui.sh b/git-gui.sh index 815725d1e1fec3068e07320a682becd80d25fff9..8ade423eb46006025e56ee68e49230a8e8efb579 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -128,6 +128,7 @@ set _githtmldir {} set _reponame {} set _iscygwin {} set _search_path {} +set _shellpath {@@SHELL_PATH@@} set _trace [lsearch -exact $argv --trace] if {$_trace >= 0} { @@ -137,6 +138,11 @@ if {$_trace >= 0} { set _trace 0 } +proc shellpath {} { + global _shellpath + return $_shellpath +} + proc appname {} { global _appname return $_appname diff --git a/lib/blame.tcl b/lib/blame.tcl index 2137ec9684d0acdb386e6b50e1b41aa7705c9746..77656d3675c5c128eafe3667d5fcb95e38559b9f 100644 --- a/lib/blame.tcl +++ b/lib/blame.tcl @@ -460,7 +460,9 @@ method _load {jump} { } if {$commit eq {}} { if {$do_textconv ne 0} { - set fd [open |[list $textconv $path] r] + # Run textconv with sh -c "..." to allow it to + # contain command + arguments. + set fd [open |[list [shellpath] -c "$textconv \"\$0\"" $path] r] } else { set fd [open $path r] }