Skip to content

Commit b575b2f

Browse files
patthoytspaulusmack
authored andcommitted
gitk: Handle external diff tool with spaces in the path
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 <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent c876dba commit b575b2f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

gitk

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3245,9 +3245,8 @@ proc external_diff {} {
32453245
set difftofile [external_diff_get_one_file $diffidto $flist_menu_file $diffdir]
32463246

32473247
if {$difffromfile ne {} && $difftofile ne {}} {
3248-
set cmd [concat | [shellsplit $extdifftool] \
3249-
[list $difffromfile $difftofile]]
3250-
if {[catch {set fl [open $cmd r]} err]} {
3248+
set cmd [list [shellsplit $extdifftool] $difffromfile $difftofile]
3249+
if {[catch {set fl [open |$cmd r]} err]} {
32513250
file delete -force $diffdir
32523251
error_popup "$extdifftool: [mc "command failed:"] $err"
32533252
} else {

0 commit comments

Comments
 (0)