diff options
badwolf.c: Simplify badwolf_ensure_uri_scheme()
1 files changed, 1 insertions, 13 deletions
| -rw-r--r-- | badwolf.c | 14 |
@@ -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); } |