summaryrefslogtreecommitdiff
path: root/browser.c
diff options
context:
space:
mode:
Diffstat (limited to 'browser.c')
-rw-r--r--browser.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/browser.c b/browser.c
index 3cf7d60..d411f6a 100644
--- a/browser.c
+++ b/browser.c
@@ -1,3 +1,4 @@
+#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
@@ -501,7 +502,7 @@ downloadmanager_setup(void)
gchar *
ensure_uri_scheme(const gchar *t)
{
- gchar *f;
+ gchar *f, *fabs;
f = g_ascii_strdown(t, -1);
if (!g_str_has_prefix(f, "http:") &&
@@ -510,7 +511,14 @@ ensure_uri_scheme(const gchar *t)
!g_str_has_prefix(f, "about:"))
{
g_free(f);
- f = g_strdup_printf("http://%s", t);
+ fabs = realpath(t, NULL);
+ if (fabs != NULL)
+ {
+ f = g_strdup_printf("file://%s", fabs);
+ free(fabs);
+ }
+ else
+ f = g_strdup_printf("http://%s", t);
return f;
}
else