From 6330b49112bc38398d12943d84baff2644f1cfea Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Tue, 19 Feb 2013 02:04:42 +0000 Subject: [PATCH] fix path bug from r14034 --- macosx/Torrent.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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]; } -- 2.40.0