tFix url parsing in load() - surf - customized build of surf, the suckless webk… | |
git clone git://src.adamsgaard.dk/surf | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 3530d18d8ed04710d5e5a0bfbf6af948c59549bf | |
parent 7ca9421a69956c27b010cc9fc6162df7fa9699cf | |
Author: Quentin Rameau <[email protected]> | |
Date: Sat, 16 Apr 2016 06:19:13 +0200 | |
Fix url parsing in load() | |
Diffstat: | |
M surf.c | 5 ++++- | |
1 file changed, 4 insertions(+), 1 deletion(-) | |
--- | |
diff --git a/surf.c b/surf.c | |
t@@ -415,7 +415,10 @@ loaduri(Client *c, const Arg *a) | |
if (g_strcmp0(uri, "") == 0) | |
return; | |
- if (g_strrstr(uri, "://") || g_str_has_prefix(uri, "about:")) { | |
+ if (g_str_has_prefix(uri, "http://") || | |
+ g_str_has_prefix(uri, "https://") || | |
+ g_str_has_prefix(uri, "file://") || | |
+ g_str_has_prefix(uri, "about:")) { | |
url = g_strdup(uri); | |
} else if (!stat(uri, &st) && (path = realpath(uri, NULL))) { | |
url = g_strdup_printf("file://%s", path); |