# [PATCH] git-gui: fix browsers [Up To Parent] in sub-sub-directories.

2 messages from 2010-11-19 to 2010-11-22. Participants: Bert Wesarg, Pat Thoyts.
Thread: https://gitlist.dev/t/25792

## Bert Wesarg, 2010-11-19 20:43

Subject: [PATCH] git-gui: fix browsers [Up To Parent] in sub-sub-directories.
Message-ID: <1290199429-30421-1-git-send-email-bert.wesarg@googlemail.com>
URL: https://gitlist.dev/e/1290199429-30421-1-git-send-email-bert.wesarg%40googlemail.com

```
browser_path used to end with a slash, so the regexp matches the empty string
and therefore removes nothing.

Fix this.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>

---
 git-gui/lib/browser.tcl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-gui/lib/browser.tcl b/git-gui/lib/browser.tcl
index c241572..a8c6223 100644
--- a/git-gui/lib/browser.tcl
+++ b/git-gui/lib/browser.tcl
@@ -121,7 +121,7 @@ method _parent {} {
 		if {$browser_stack eq {}} {
 			regsub {:.*$} $browser_path {:} browser_path
 		} else {
-			regsub {/[^/]+$} $browser_path {} browser_path
+			regsub {/[^/]+/$} $browser_path {/} browser_path
 		}
 		set browser_status [mc "Loading %s..." $browser_path]
 		_ls $this [lindex $parent 0] [lindex $parent 1]
-- 
tg: (6f10c41..) bw/git-gui/fix-browser-up (depends on: master)

```

## Pat Thoyts, 2010-11-22 21:58

Subject: Re: [PATCH] git-gui: fix browsers [Up To Parent] in sub-sub-directories.
Message-ID: <87vd3pf2c1.fsf@fox.patthoyts.tk>
URL: https://gitlist.dev/e/87vd3pf2c1.fsf%40fox.patthoyts.tk
In-Reply-To: <1290199429-30421-1-git-send-email-bert.wesarg@googlemail.com>

```
Bert Wesarg <bert.wesarg@googlemail.com> writes:

>browser_path used to end with a slash, so the regexp matches the empty string
>and therefore removes nothing.
>
>Fix this.
>
>Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
>
>---
> git-gui/lib/browser.tcl |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
>diff --git a/git-gui/lib/browser.tcl b/git-gui/lib/browser.tcl
>index c241572..a8c6223 100644
>--- a/git-gui/lib/browser.tcl
>+++ b/git-gui/lib/browser.tcl
>@@ -121,7 +121,7 @@ method _parent {} {
> 		if {$browser_stack eq {}} {
> 			regsub {:.*$} $browser_path {:} browser_path
> 		} else {
>-			regsub {/[^/]+$} $browser_path {} browser_path
>+			regsub {/[^/]+/$} $browser_path {/} browser_path
> 		}
> 		set browser_status [mc "Loading %s..." $browser_path]
> 		_ls $this [lindex $parent 0] [lindex $parent 1]

Thanks - applied to git-gui master.
-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD

```
