mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 20:35:36 +00:00
(trunk gtk) #3971 "favicons do not work for IP addresses" -- fixed.
gtr_get_host_from_url() wasn't written to handle dotted-quad or IPv6 address strings, but can handle them now.
This commit is contained in:
@@ -70,10 +70,12 @@ get_name_from_host( const char * host )
|
||||
char * name;
|
||||
const char * dot = strrchr( host, '.' );
|
||||
|
||||
if( dot == NULL )
|
||||
if( tr_addressIsIP( host ) )
|
||||
name = g_strdup( host );
|
||||
else
|
||||
else if( dot )
|
||||
name = g_strndup( host, dot - host );
|
||||
else
|
||||
name = g_strdup( host );
|
||||
|
||||
*name = g_ascii_toupper( *name );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user