From: Mitchell Livingston Date: Tue, 19 Feb 2013 02:04:42 +0000 (+0000) Subject: fix path bug from r14034 X-Git-Tag: 2.80~65 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6330b49112bc38398d12943d84baff2644f1cfea;p=transmission fix path bug from r14034 --- diff --git a/macosx/Torrent.m b/macosx/Torrent.m index 2d3527286..3fb0e32f1 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -1726,7 +1726,7 @@ int trashDataFile(const char * filename) const NSInteger count = [self fileCount]; NSMutableArray * flatFileList = [NSMutableArray arrayWithCapacity: count]; - FileListNode * tempNode = [[FileListNode alloc] initWithFolderName:nil path:nil torrent:self]; + FileListNode * tempNode = nil; for (NSInteger i = 0; i < count; i++) { @@ -1734,6 +1734,10 @@ int trashDataFile(const char * filename) NSString * fullPath = [NSString stringWithUTF8String: file->name]; NSArray * pathComponents = [fullPath pathComponents]; + + if (!tempNode) + tempNode = [[FileListNode alloc] initWithFolderName:[pathComponents objectAtIndex: 0] path:@"" torrent:self]; + [self insertPathForComponents: pathComponents withComponentIndex: 1 forParent: tempNode fileSize: file->length index: i flatList: flatFileList]; }