(trunk libT) fix downloadDir error reported & tracked down by wereHamster

This commit is contained in:
Charles Kerr 2009-01-09 18:39:30 +00:00
parent a1b2af981c
commit b545dbe28a
1 changed files with 10 additions and 5 deletions

View File

@ -437,8 +437,9 @@ torrentRealInit( tr_session * session,
int doStart;
uint64_t loaded;
uint64_t t;
tr_info * info = &tor->info;
const char * dir;
static int nextUniqueId = 1;
tr_info * info = &tor->info;
tr_globalLock( session );
@ -451,6 +452,10 @@ torrentRealInit( tr_session * session,
tor->blockSize = getBlockSize( info->pieceSize );
if( !tr_ctorGetDownloadDir( ctor, TR_FORCE, &dir ) ||
!tr_ctorGetDownloadDir( ctor, TR_FALLBACK, &dir ) )
tor->downloadDir = tr_strdup( dir );
tor->lastPieceSize = info->totalSize % info->pieceSize;
if( !tor->lastPieceSize )