Skip to content

Commit

Permalink
gitk: Handle external diff tool with spaces in the path
Browse files Browse the repository at this point in the history
This fixes the launching of external diff to handle a diff tool
that has spaces in the path.  This ensures a correctly formed
tcl list is passed to the open command with a single pipe character
prefixing the list (as per the tcl manual page for open).

The specific fault observed was that selecting WinMerge as the diff
tool from the default installed location in Program Files failed to
be launched from the context menu.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Pat Thoyts authored and Paul Mackerras committed Apr 17, 2009
1 parent c876dba commit b575b2f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions gitk
Original file line number Diff line number Diff line change
Expand Up @@ -3245,9 +3245,8 @@ proc external_diff {} {
set difftofile [external_diff_get_one_file $diffidto $flist_menu_file $diffdir]

if {$difffromfile ne {} && $difftofile ne {}} {
set cmd [concat | [shellsplit $extdifftool] \
[list $difffromfile $difftofile]]
if {[catch {set fl [open $cmd r]} err]} {
set cmd [list [shellsplit $extdifftool] $difffromfile $difftofile]
if {[catch {set fl [open |$cmd r]} err]} {
file delete -force $diffdir
error_popup "$extdifftool: [mc "command failed:"] $err"
} else {
Expand Down

0 comments on commit b575b2f

Please sign in to comment.