From: Radoslav Georgiev Date: Tue, 16 Apr 2019 20:23:03 +0000 (+0300) Subject: torrentfs: fix a bug where ENOENT is returned when the node for an entry in the root... X-Git-Tag: v1.1.4~2 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=8249316c780dab510d70bd13bd3696123c905657;p=btrtrc.git torrentfs: fix a bug where ENOENT is returned when the node for an entry in the root directory of a torrent is requested --- diff --git a/fs/torrentfs.go b/fs/torrentfs.go index 8e3e6898..1bcc85fa 100644 --- a/fs/torrentfs.go +++ b/fs/torrentfs.go @@ -102,7 +102,12 @@ func (dn dirNode) ReadDirAll(ctx context.Context) (des []fuse.Dirent, err error) func (dn dirNode) Lookup(_ context.Context, name string) (fusefs.Node, error) { dir := false var file *torrent.File - fullPath := dn.path + "/" + name + var fullPath string + if dn.path != "" { + fullPath = dn.path + "/" + name + } else { + fullPath = name + } for _, f := range dn.t.Files() { if f.DisplayPath() == fullPath { file = f