From f954b649c6ee805d56f135c7ba38ebe97288c7bb Mon Sep 17 00:00:00 2001 From: nsf Date: Mon, 9 Jul 2012 03:37:16 +0600 Subject: [PATCH] torrent: Fix bug with common part not being cut off. --- torrent/builder.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/torrent/builder.go b/torrent/builder.go index b3db7d41..20103b60 100644 --- a/torrent/builder.go +++ b/torrent/builder.go @@ -127,7 +127,6 @@ func (b *Builder) Submit() (*Batch, error) { file.splitpath = split_path(f) file.size = fi.Size() batch.files = append(batch.files, file) - batch.TotalSize += file.size } @@ -163,7 +162,8 @@ func (b *Builder) Submit() (*Batch, error) { batch.DefaultName = common[len(common)-1] lcommon := len(common) - for _, f := range batch.files { + for i := range batch.files { + f := &batch.files[i] f.splitpath = f.splitpath[lcommon:] } -- 2.48.1