Summary Files Commits Branches @commit @diff @stats
path: root / badwolf.c
diff options
context:
space:
mode:
Commit13f01bbd402ab667e7ee80afc3cfaee2f7b92f44 (patch)
Author
 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
2019-12-07 10:40:42 +0100
Committer
 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
2019-12-15 19:10:52 +0100
Filesd322d9a7f90c8dd79fd5c4b30cfca271c2ae7a99 /badwolf.c
goodwolf-13f01bbd402ab667e7ee80afc3cfaee2f7b92f44.tar
goodwolf-13f01bbd402ab667e7ee80afc3cfaee2f7b92f44.tar.gz
goodwolf-13f01bbd402ab667e7ee80afc3cfaee2f7b92f44.zip
Parente352d548e49bb448ba2b1db46a61163f65ec6abb (diff)
badwolf.c: Simplify badwolf_ensure_uri_scheme()
1 files changed, 1 insertions, 13 deletions
-rw-r--r--badwolf.c14
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);
}