]> Sergey Matveev's repositories - btrtrc.git/blobdiff - storage/mmap.go
fix: can not download invalid utf8 name with BestName and BestPath (#915)
[btrtrc.git] / storage / mmap.go
index 1851c3238d2618cdc1c43789dff6189013ae2908..f7536591fabb9db61df691b09556ff6f59f6b5b4 100644 (file)
@@ -119,7 +119,7 @@ func mMapTorrent(md *metainfo.Info, location string) (mms *mmap_span.MMapSpan, e
        }()
        for _, miFile := range md.UpvertedFiles() {
                var safeName string
-               safeName, err = ToSafeFilePath(append([]string{md.Name}, miFile.Path...)...)
+               safeName, err = ToSafeFilePath(append([]string{md.BestName()}, miFile.BestPath()...)...)
                if err != nil {
                        return
                }