Changeset 11801
Legend:
- Unmodified
- Added
- Removed
-
trunk/gtk/filter.c
r11709 r11801 71 71 const char * dot = strrchr( host, '.' ); 72 72 73 if( dot == NULL)73 if( tr_addressIsIP( host ) ) 74 74 name = g_strdup( host ); 75 else if( dot ) 76 name = g_strndup( host, dot - host ); 75 77 else 76 name = g_str ndup( host, dot -host );78 name = g_strdup( host ); 77 79 78 80 *name = g_ascii_toupper( *name ); -
trunk/gtk/util.c
r11743 r11801 254 254 char * h = NULL; 255 255 char * name; 256 const char * first_dot;257 const char * last_dot;258 256 259 257 tr_urlParse( url, -1, NULL, &h, NULL, NULL ); 260 first_dot = strchr( h, '.' ); 261 last_dot = strrchr( h, '.' ); 262 263 if( ( first_dot ) && ( last_dot ) && ( first_dot != last_dot ) ) 264 name = g_strdup( first_dot + 1 ); 265 else 258 259 if( tr_addressIsIP( h ) ) 266 260 name = g_strdup( h ); 261 else { 262 const char * first_dot = strchr( h, '.' ); 263 const char * last_dot = strrchr( h, '.' ); 264 if( ( first_dot ) && ( last_dot ) && ( first_dot != last_dot ) ) 265 name = g_strdup( first_dot + 1 ); 266 else 267 name = g_strdup( h ); 268 } 267 269 268 270 tr_free( h );
Note: See TracChangeset
for help on using the changeset viewer.