diff options
author | Alan Fitton <ajf@eth0.org.uk> | 2011-03-10 14:57:38 +0000 |
---|---|---|
committer | Alan Fitton <ajf@eth0.org.uk> | 2011-03-10 14:57:38 +0000 |
commit | a1433a45c470950b3f03541257ef54c4bb48d449 (patch) | |
tree | 9e285c6bf2d0508f10b0ada60761f1bee2eb98f8 /src/util.c | |
parent | ce795861eeb1893e40e4476fea71986450658948 (diff) |
Korean support, thanks Youn! Also filter by tracker. Adding/removing trackers from the state selector every update seems like a waste of cycles, so only refresh when a torrent is added.
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -34,6 +34,23 @@ #include "util.h" #include "dispatch.h" +GRegex *trg_uri_host_regex_new(void) +{ + return g_regex_new("^[^:/?#]+:?//([^/?#]*)", 0, 0, NULL); +} + +gchar *trg_uri_host_extract(GRegex *rx, const gchar *uri) +{ + GMatchInfo *mi = NULL; + gchar *host = NULL; + g_regex_match (rx, uri, 0, &mi); + if (mi) { + host = g_match_info_fetch(mi, 1); + g_match_info_free (mi); + } + return host; +} + void trg_error_dialog(GtkWindow * parent, int status, JsonObject * response) { |