diff options
author | TingPing <tingping@tingping.se> | 2013-06-18 20:40:07 -0400 |
---|---|---|
committer | TingPing <tingping@tingping.se> | 2013-06-18 20:40:07 -0400 |
commit | 64ba92593ec39de86c98b1b3b59154cbad60bc9a (patch) | |
tree | 031723a25bb08b2090e79cd3179924bf2c66172b /src/fe-gtk/fe-gtk.c | |
parent | 33b5dc1c75d5de83c7d49c090266c23961717088 (diff) | |
parent | 02139fbb79e8a761ade80a6fffc03f072d97b3da (diff) |
fix merge conflict
Diffstat (limited to 'src/fe-gtk/fe-gtk.c')
-rw-r--r-- | src/fe-gtk/fe-gtk.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/fe-gtk/fe-gtk.c b/src/fe-gtk/fe-gtk.c index 28a3b1d5..6890286f 100644 --- a/src/fe-gtk/fe-gtk.c +++ b/src/fe-gtk/fe-gtk.c @@ -1008,11 +1008,13 @@ fe_open_url_inner (const char *url) static void fe_open_url_locale (const char *url) { - if (url_check_word (url) == WORD_PATH) + int url_type = url_check_word (url); + char *uri; + + /* gvfs likes file:// */ + if (url_type == WORD_PATH) { #ifndef WIN32 - char *uri; - uri = g_strconcat ("file://", url, NULL); fe_open_url_inner (uri); g_free (uri); @@ -1020,6 +1022,18 @@ fe_open_url_locale (const char *url) fe_open_url_inner (url); #endif } + /* IPv6 addr. Add http:// */ + else if (url_type == WORD_HOST6) + { + /* IPv6 addrs in urls should be enclosed in [ ] */ + if (*url != '[') + uri = g_strdup_printf ("http://[%s]", url); + else + uri = g_strdup_printf ("http://%s", url); + + fe_open_url_inner (uri); + g_free (uri); + } /* the http:// part's missing, prepend it, otherwise it won't always work */ else if (strchr (url, ':') == NULL) { |