handle trailing slash in PWD properly

cc #558
This commit is contained in:
Gokcehan 2022-03-18 21:59:11 +03:00
parent f66e5824a1
commit 12f0f0da68

2
nav.go
View File

@ -447,6 +447,8 @@ func (nav *nav) checkDir(dir *dir) {
func (nav *nav) getDirs(wd string) { func (nav *nav) getDirs(wd string) {
var dirs []*dir var dirs []*dir
wd = filepath.Clean(wd)
for curr, base := wd, ""; !isRoot(base); curr, base = filepath.Dir(curr), filepath.Base(curr) { for curr, base := wd, ""; !isRoot(base); curr, base = filepath.Dir(curr), filepath.Base(curr) {
dir := nav.loadDir(curr) dir := nav.loadDir(curr)
dir.sel(base, nav.height) dir.sel(base, nav.height)