comparison gui/ui/gtk/url.c @ 34959:ae29467e3294

Allow more liberal URL handling. Don't restrict the recognized protocols, but only force http:// if there is no :// in a given string at all.
author ib
date Sat, 28 Jul 2012 23:57:25 +0000
parents 00e8aecfa7ff
children 60930e7347c6
comparison
equal deleted inserted replaced
34958:a2ae66db73b2 34959:ae29467e3294
87 { 87 {
88 gchar * str= strdup( gtk_entry_get_text( GTK_ENTRY( URLEntry ) ) ); 88 gchar * str= strdup( gtk_entry_get_text( GTK_ENTRY( URLEntry ) ) );
89 89
90 if ( str ) 90 if ( str )
91 { 91 {
92 if ( strncmp( str,"http://",7 ) 92 if ( !strstr( str,"://" ) )
93 && strncmp( str,"ftp://",6 )
94 && strncmp( str,"mms://",6 )
95 && strncmp( str,"pnm://",6 )
96 && strncmp( str,"rtsp://",7 ) )
97 { 93 {
98 gchar * tmp; 94 gchar * tmp;
99 tmp=malloc( strlen( str ) + 8 ); 95 tmp=malloc( strlen( str ) + 8 );
100 sprintf( tmp,"http://%s",str ); 96 sprintf( tmp,"http://%s",str );
101 free( str ); str=tmp; 97 free( str ); str=tmp;