mirror of
https://github.com/transmission/transmission
synced 2024-12-26 17:47:37 +00:00
(trunk libT) #4237 "tarnsmission-remote -l shows torrent list in reverse order" -- revert r12424 to fix this
This commit is contained in:
parent
5b01685146
commit
7cd9cc0176
1 changed files with 12 additions and 3 deletions
|
@ -869,9 +869,18 @@ torrentInit( tr_torrent * tor, const tr_ctor * ctor )
|
|||
}
|
||||
|
||||
/* add the torrent to tr_session.torrentList */
|
||||
tor->next = 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;
|
||||
}
|
||||
|
||||
/* if we don't have a local .torrent file already, assume the torrent is new */
|
||||
isNewTorrent = stat( tor->info.torrent, &st );
|
||||
|
|
Loading…
Reference in a new issue