diff options
Diffstat (limited to 'src/fe-gtk/fe-gtk.c')
-rw-r--r-- | src/fe-gtk/fe-gtk.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/fe-gtk/fe-gtk.c b/src/fe-gtk/fe-gtk.c index e3b4ec80..6890286f 100644 --- a/src/fe-gtk/fe-gtk.c +++ b/src/fe-gtk/fe-gtk.c @@ -1009,21 +1009,33 @@ static void fe_open_url_locale (const char *url) { int url_type = url_check_word (url); + char *uri; + /* gvfs likes file:// */ + if (url_type == WORD_PATH) + { +#ifndef WIN32 + uri = g_strconcat ("file://", url, NULL); + fe_open_url_inner (uri); + g_free (uri); +#else + fe_open_url_inner (url); +#endif + } /* IPv6 addr. Add http:// */ - if (url_type == WORD_HOST6) + else if (url_type == WORD_HOST6) { /* IPv6 addrs in urls should be enclosed in [ ] */ if (*url != '[') - url = g_strdup_printf ("http://[%s]", url); + uri = g_strdup_printf ("http://[%s]", url); else - url = g_strdup_printf ("http://%s", url); + uri = g_strdup_printf ("http://%s", url); - fe_open_url_inner (url); - g_free ((char *)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 && url_type != WORD_PATH) + else if (strchr (url, ':') == NULL) { url = g_strdup_printf ("http://%s", url); fe_open_url_inner (url); |