]> granicus.if.org Git - transmission/commitdiff
(trunk, libT) #5081 'Transmission discards webseed URLs that have trailing whitespace...
authorJordan Lee <jordan@transmissionbt.com>
Sun, 14 Oct 2012 18:10:17 +0000 (18:10 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Sun, 14 Oct 2012 18:10:17 +0000 (18:10 +0000)
libtransmission/metainfo-test.c
libtransmission/metainfo.c

index 71fca392e65e62404e8a7a9b53163b359368ecd7..51da5b1796da983be8ef9db660559de9dac102fa 100644 (file)
@@ -1,7 +1,7 @@
 #include "transmission.h"
 #include "utils.h" /* tr_strcmp0 */
 
-#define VERBOSE
+#undef VERBOSE
 #include "libtransmission-test.h"
 
 static int
index aab3aa2e65655aefbdec224f40fd0d8049b6732b..64961dc40abaed58ab27f7967734b49cb721e2a9 100644 (file)
@@ -371,10 +371,15 @@ getannounce( tr_info * inf, tr_benc * meta )
  * trailing slash for multifile torrents if omitted by the end user.
  */
 static char*
-fix_webseed_url( const tr_info * inf, const char * url )
+fix_webseed_url( const tr_info * inf, const char * url_in )
 {
+    size_t len;
+    char * url;
     char * ret = NULL;
-    const size_t len = strlen( url );
+
+    url = tr_strdup( url_in );
+    tr_strstrip( url );
+    len = strlen( url );
 
     if( tr_urlIsValid( url, len ) )
     {
@@ -384,6 +389,7 @@ fix_webseed_url( const tr_info * inf, const char * url )
             ret = tr_strndup( url, len );
     }
 
+    tr_free( url );
     return ret;
 }