#811: fix r5329 error in trunk.

This commit is contained in:
Charles Kerr 2008-03-24 16:10:04 +00:00
parent 910d77ae12
commit b3663db916
1 changed files with 8 additions and 6 deletions

View File

@ -1231,12 +1231,14 @@ setFileDND( tr_torrent * tor,
/* can't set the first piece to DND unless
every file using that piece is DND */
firstPieceDND = dnd;
for( i=fileIndex-1; firstPieceDND; --i ) {
if( tor->info.files[i].lastPiece != firstPiece )
break;
firstPieceDND = tor->info.files[i].dnd;
if( !i )
break;
if( fileIndex > 0 ) {
for( i=fileIndex-1; firstPieceDND; --i ) {
if( tor->info.files[i].lastPiece != firstPiece )
break;
firstPieceDND = tor->info.files[i].dnd;
if( !i )
break;
}
}
/* can't set the last piece to DND unless