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>
This commit is contained in:
Bert Wesarg 2010-11-23 08:37:50 +01:00 committed by Pat Thoyts
parent ae6ec6124b
commit 80e6667809

View File

@ -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 \