From 65535e1d875d8e7c51f4ec1bec1aa5593c8e2cc5 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sat, 26 Jan 2008 15:18:32 +0100 Subject: [PATCH] Build fix: Don't use regular expressions --- src/helpers.c | 2 +- src/webView.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/helpers.c b/src/helpers.c index 8a114586..2b824757 100644 --- a/src/helpers.c +++ b/src/helpers.c @@ -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) diff --git a/src/webView.c b/src/webView.c index 54870fce..be91e220 100644 --- a/src/webView.c +++ b/src/webView.c @@ -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)