1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-01-31 03:12:44 +00:00

(trunk libT) better r12434

This commit is contained in:
Jordan Lee 2011-05-16 07:11:21 +00:00
parent 7cd9cc0176
commit 52512857ae
2 changed files with 9 additions and 12 deletions

View file

@ -1881,7 +1881,7 @@ tr_sessionLoadTorrents( tr_session * session,
tr_ctorSetMetainfoFromFile( ctor, path );
if(( tor = tr_torrentNew( ctor, NULL )))
{
tr_list_append( &list, tor );
tr_list_prepend( &list, tor );
++n;
}
tr_free( path );

View file

@ -869,17 +869,14 @@ torrentInit( tr_torrent * tor, const tr_ctor * ctor )
}
/* add the torrent to tr_session.torrentList */
{
tr_torrent * it = NULL;
tr_torrent * last = NULL;
while(( it = tr_torrentNext( session, it )))
last = it;
if( !last )
session->torrentList = tor;
else
last->next = tor;
++session->torrentCount;
++session->torrentCount;
if( session->torrentList == NULL )
session->torrentList = tor;
else {
tr_torrent * it = session->torrentList;
while( it->next != NULL )
it = it->next;
it->next = tor;
}
/* if we don't have a local .torrent file already, assume the torrent is new */