{"thread":{"id":"18883","subject":"[PATCH] gitk: handle external diff tool with spaces in the path","startedAt":"2009-04-15T15:54:19Z","lastAt":"2009-04-15T15:54:19Z","messageCount":1,"participants":["Pat Thoyts"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"111366","messageId":"87tz4pnc9g.fsf@users.sourceforge.net","threadId":"18883","inReplyTo":null,"subject":"[PATCH] gitk: handle external diff tool with spaces in the path","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2009-04-15T15:54:19Z","receivedAt":"2009-04-15T15:54:19Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"\n  This fixes the launching of external diff to handle a diff tool\n  that has spaces in the path. This patch ensures a correctly formed\n  tcl list is passed to the open command with a single pipe character\n  prefixing the list (as per the tcl manual page for open).\n\n  The specific fault observed was that selecting WinMerge as the diff\n  tool from the default installed location in Program Files failed to\n  be launched from the context menu.\n\nSigned-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>\n---\n gitk |    5 ++---\n 1 files changed, 2 insertions(+), 3 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex edb3ba2..656c2c1 100755\n--- a/gitk\n+++ b/gitk\n@@ -3237,9 +3237,8 @@ proc external_diff {} {\n     set difftofile [external_diff_get_one_file $diffidto $flist_menu_file $diffdir]\n \n     if {$difffromfile ne {} && $difftofile ne {}} {\n-        set cmd [concat | [shellsplit $extdifftool] \\\n-\t\t     [list $difffromfile $difftofile]]\n-        if {[catch {set fl [open $cmd r]} err]} {\n+        set cmd [list [shellsplit $extdifftool] $difffromfile $difftofile]\n+        if {[catch {set fl [open |$cmd r]} err]} {\n             file delete -force $diffdir\n             error_popup \"$extdifftool: [mc \"command failed:\"] $err\"\n         } else {\n-- \n1.6.2.2.1669.g7eaf8\n"}]}