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 <bert.wesarg@googlemail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>

Bert Wesarg committed Nov 23, 2010 at 08:37 UTC 80e66678092700354f8cfc334eab62861d509201
1 file changed +7 -1
lib/browser.tcl
+7 -1
@@ -26,8 +26,14 @@ constructor new {commit {path {}}} {
26 wm withdraw $top
27 wm title $top [append "[appname] ([reponame]): " [mc "File Browser"]]
28
29 + if {$path ne {}} {
30 + if {[string index $path end] ne {/}} {
31 + append path /
32 + }
33 + }
34 +
35 set browser_commit $commit
30 - set browser_path $browser_commit:$path
36 + set browser_path "$browser_commit:[escape_path $path]"
37
38 ${NS}::label $w.path \
39 -textvariable @browser_path \