From f6a5117ef990027f22852eed2142cfa39e66fce0 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Fri, 25 Dec 2009 16:56:33 +0000 Subject: [PATCH] calculate proper file progress for 0-byte files (fixes #2689) --- libtransmission/torrent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index cdf68a64d..3af081605 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -1125,7 +1125,7 @@ tr_torrentFiles( const tr_torrent * tor, for( i=0; iinfo.files[i].length : fileBytesCompleted( tor, i ); walk->bytesCompleted = b; - walk->progress = tr_getRatio( b, tor->info.files[i].length ); + walk->progress = tor->info.files[i].length > 0.0 ? ( b / tor->info.files[i].length ) : 1.0; } if( fileCount )