From 80e66678092700354f8cfc334eab62861d509201 Mon Sep 17 00:00:00 2001 From: Bert Wesarg Date: Tue, 23 Nov 2010 08:37:50 +0100 Subject: [PATCH] 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 --- lib/browser.tcl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 \ -- 2.26.2