From 13f01bbd402ab667e7ee80afc3cfaee2f7b92f44 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 7 Dec 2019 10:40:42 +0100 Subject: badwolf.c: Simplify badwolf_ensure_uri_scheme() --- badwolf.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/badwolf.c b/badwolf.c index 866a4ba..fc26407 100644 --- a/badwolf.c +++ b/badwolf.c @@ -81,19 +81,7 @@ badwolf_ensure_uri_scheme(gchar *text, gboolean try_file) soup_uri_free(uri); - if(try_file) - { - gchar *f; - char *path; - path = realpath(text, NULL); - - if(path != NULL) - { - f = g_strdup_printf("file://%s", path); - free(path); - return f; - } - } + if(try_file && (access(text, R_OK) == 0)) return g_strdup_printf("file://%s", text); return g_strdup_printf("http://%s", text); } -- cgit v1.3.1-23-gd82d