From 8292c090380f8bbc5b03524a589fce11ac1a1189 Mon Sep 17 00:00:00 2001 From: DenKoren Date: Mon, 25 Mar 2024 07:58:26 +0100 Subject: [PATCH] fix: do not clean bpath when it is empty to not root into '.' --- basepath.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/basepath.go b/basepath.go index faa1012..251c1a0 100644 --- a/basepath.go +++ b/basepath.go @@ -55,7 +55,10 @@ func (b *BasePathFs) RealPath(name string) (path string, err error) { return name, err } - bpath := filepath.Clean(b.path) + bpath := b.path + if bpath != "" { + bpath = filepath.Clean(b.path) + } path = filepath.Clean(filepath.Join(bpath, name)) if !strings.HasPrefix(path, bpath) { return name, os.ErrNotExist