torrent: Fix bug with common part not being cut off.

This commit is contained in:
nsf 2012-07-09 03:37:16 +06:00
parent 0e3b555c7e
commit f954b649c6
1 changed files with 2 additions and 2 deletions

View File

@ -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:]
}