Build fix: Don't use regular expressions

This commit is contained in:
Christian Dywan 2008-01-26 15:18:32 +01:00
parent 1522f47002
commit 65535e1d87
2 changed files with 2 additions and 3 deletions

View file

@ -417,7 +417,7 @@ gchar* magic_uri(const gchar* uri, gboolean search)
if(!strstr(uri, "://")) if(!strstr(uri, "://"))
{ {
// Do we have a domain, ip address or localhost? // Do we have a domain, ip address or localhost?
if(strstr(uri, ".") != NULL || !strcmp(uri, "localhost")) if(strchr(uri, '.') != NULL || !strcmp(uri, "localhost"))
return g_strconcat("http://", uri, NULL); return g_strconcat("http://", uri, NULL);
// We don't want to search? So return early. // We don't want to search? So return early.
if(!search) if(!search)

View file

@ -259,8 +259,7 @@ gboolean on_webView_button_press_after(GtkWidget* webView, GdkEventButton* event
GtkClipboard* clipboard = gtk_clipboard_get(GDK_SELECTION_PRIMARY); GtkClipboard* clipboard = gtk_clipboard_get(GDK_SELECTION_PRIMARY);
gchar* text = gtk_clipboard_wait_for_text(clipboard); gchar* text = gtk_clipboard_wait_for_text(clipboard);
gchar* uri = NULL; gchar* uri = NULL;
if(text && g_regex_match_simple("^[^ ]*$", text if(text && strchr(text, '.') && !strchr(text, ' '))
, G_REGEX_CASELESS, G_REGEX_MATCH_NOTEMPTY))
uri = magic_uri(text, FALSE); uri = magic_uri(text, FALSE);
g_free(text); g_free(text);
if(uri) if(uri)