2
0
mirror of synced 2025-02-24 06:38:14 +00:00

torrentfs: fix a bug where ENOENT is returned when the node for an entry in the root directory of a torrent is requested

This commit is contained in:
Radoslav Georgiev 2019-04-16 23:23:03 +03:00 committed by Matt Joiner
parent 0238a3d30b
commit 8249316c78

View File

@ -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