From: Bert Wesarg Date: Tue, 23 Nov 2010 07:37:50 +0000 (+0100) Subject: git-gui: fix display of path in browser title X-Git-Tag: gitgui-0.16.0~15 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=80e66678092700354f8cfc334eab62861d509201;p=git.git git-gui: fix display of path in browser title Ensure the browser path is shown on the title with a / suffix and escape any backslashes or newlines in path elements before display. Signed-off-by: Bert Wesarg Signed-off-by: Pat Thoyts --- diff --git a/lib/browser.tcl b/lib/browser.tcl index a8c622351..0328338fd 100644 --- a/lib/browser.tcl +++ b/lib/browser.tcl @@ -26,8 +26,14 @@ constructor new {commit {path {}}} { wm withdraw $top wm title $top [append "[appname] ([reponame]): " [mc "File Browser"]] + if {$path ne {}} { + if {[string index $path end] ne {/}} { + append path / + } + } + set browser_commit $commit - set browser_path $browser_commit:$path + set browser_path "$browser_commit:[escape_path $path]" ${NS}::label $w.path \ -textvariable @browser_path \