mirror of
https://github.com/transmission/transmission
synced 2025-01-30 19:03:04 +00:00
(trunk libT) better r12434
This commit is contained in:
parent
7cd9cc0176
commit
52512857ae
2 changed files with 9 additions and 12 deletions
|
@ -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 );
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue