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