From d60fa654cb9932dc90e83464eb5cf1748aa5fc81 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Fri, 30 Oct 2009 02:58:30 +0000 Subject: [PATCH] (trunk libT) fix regression introduced by #2539 that caused single-file torrents to not be deleted even if the user requested it --- libtransmission/torrent.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index 1aa6d3e57..c81af0bf2 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -2353,12 +2353,24 @@ tr_torrentDeleteLocalData( tr_torrent * tor, tr_fileFunc fileFunc ) tr_fdTorrentClose( tor->session, tor->uniqueId ); if( tor->info.fileCount > 1 ) + { deleteLocalData( tor, fileFunc ); - else { + } + else + { + char * tmp; + /* torrent only has one file */ char * path = tr_buildPath( tor->currentDir, tor->info.files[0].name, NULL ); fileFunc( path ); tr_free( path ); + + + tmp = tr_torrentBuildPartial( tor, 0 ); + path = tr_buildPath( tor->currentDir, tmp, NULL ); + fileFunc( path ); + tr_free( path ); + tr_free( tmp ); } }