From: Charles Kerr Date: Sun, 22 Aug 2010 18:40:18 +0000 (+0000) Subject: (trunk libT) #3519 "webseeds don't work" -- patch from gostrc to add support for... X-Git-Tag: 2.10~101 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6df6fd929bc63bfb21a0a8ec7a4e57be955efbd5;p=transmission (trunk libT) #3519 "webseeds don't work" -- patch from gostrc to add support for a single string in the url-list --- diff --git a/libtransmission/metainfo.c b/libtransmission/metainfo.c index 7b33241c1..b77249e91 100644 --- a/libtransmission/metainfo.c +++ b/libtransmission/metainfo.c @@ -360,11 +360,11 @@ geturllist( tr_info * inf, tr_benc * meta ) { tr_benc * urls; + const char * url; if( tr_bencDictFindList( meta, "url-list", &urls ) ) { int i; - const char * url; const int n = tr_bencListSize( urls ); inf->webseedCount = 0; @@ -374,6 +374,12 @@ geturllist( tr_info * inf, if( tr_bencGetStr( tr_bencListChild( urls, i ), &url ) ) inf->webseeds[inf->webseedCount++] = tr_strdup( url ); } + else if( tr_bencDictFindStr( meta, "url-list", &url ) ) /* handle single items in webseeds */ + { + inf->webseedCount = 1; + inf->webseeds = tr_new0( char*, 1 ); + inf->webseeds[0] = tr_strdup( url ); + } } static int