]> spindle.queued.net Git - midori/commitdiff
Build fix: Don't use regular expressions
authorChristian Dywan <christian@twotoasts.de>
Sat, 26 Jan 2008 14:18:32 +0000 (15:18 +0100)
committerChristian Dywan <christian@twotoasts.de>
Sat, 26 Jan 2008 14:18:32 +0000 (15:18 +0100)
src/helpers.c
src/webView.c

index 8a1145863c31ce8b2d6cc26415346ca66aede8e9..2b82475749afb4dbbac26b296e64c453516003a0 100644 (file)
@@ -417,7 +417,7 @@ gchar* magic_uri(const gchar* uri, gboolean search)
     if(!strstr(uri, "://"))
     {
         // 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);
         // We don't want to search? So return early.
         if(!search)
index 54870fce5a9e3fe0c1efc8595212579df989f570..be91e220128aee4e59ca88bd784243f7c8374780 100644 (file)
@@ -259,8 +259,7 @@ gboolean on_webView_button_press_after(GtkWidget* webView, GdkEventButton* event
         GtkClipboard* clipboard = gtk_clipboard_get(GDK_SELECTION_PRIMARY);
         gchar* text = gtk_clipboard_wait_for_text(clipboard);
         gchar* uri = NULL;
-        if(text && g_regex_match_simple("^[^ ]*$", text
-         , G_REGEX_CASELESS, G_REGEX_MATCH_NOTEMPTY))
+        if(text && strchr(text, '.') && !strchr(text, ' '))
             uri = magic_uri(text, FALSE);
         g_free(text);
         if(uri)