summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBert Wesarg <bert.wesarg@googlemail.com>2010-11-23 08:37:50 +0100
committerPat Thoyts <patthoyts@users.sourceforge.net>2011-10-19 14:13:15 +0100
commit80e66678092700354f8cfc334eab62861d509201 (patch)
tree73527340e101d319f4bf76b6cd017a1acc32ea17
parentae6ec6124bb96157ca96bc90831b4874e8ad6789 (diff)
downloadgit-80e66678092700354f8cfc334eab62861d509201.tar.gz
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>
-rw-r--r--lib/browser.tcl8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/browser.tcl b/lib/browser.tcl
index a8c6223511..0328338fda 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 \