(trunk libT) #4237 "tarnsmission-remote -l shows torrent list in reverse order" -- revert r12424 to fix this

This commit is contained in:
Jordan Lee 2011-05-16 02:09:31 +00:00
parent 5b01685146
commit 7cd9cc0176
1 changed files with 12 additions and 3 deletions

View File

@ -869,9 +869,18 @@ torrentInit( tr_torrent * tor, const tr_ctor * ctor )
}
/* add the torrent to tr_session.torrentList */
tor->next = session->torrentList;
session->torrentList = tor;
++session->torrentCount;
{
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 );