summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/util.c b/src/util.c
index 0d147bf..2e0dced 100644
--- a/src/util.c
+++ b/src/util.c
@@ -33,6 +33,11 @@
#include "util.h"
+gboolean is_magnet(gchar *string)
+{
+ return g_str_has_prefix(string, "magnet:");
+}
+
gboolean is_url(gchar *string)
{
//return g_regex_match_simple ("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?", string, 0, 0);
@@ -59,7 +64,7 @@ void g_str_slist_free(GSList * list)
GRegex *trg_uri_host_regex_new(void)
{
- return g_regex_new("^[^:/?#]+:?//(?:www\\.|tracker\\.|\\d+\\.)?([^/?#:]*)",
+ return g_regex_new("^[^:/?#]+:?//(?:www\\.|torrent\\.|torrents\\.|tracker\\.|\\d+\\.)?([^/?#:]*)",
G_REGEX_OPTIMIZE, 0, NULL);
}