diff options
Diffstat (limited to 'surf.c')
| -rw-r--r-- | surf.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -560,7 +560,7 @@ void loaduri(Client *c, const Arg *a) { struct stat st; - char *url, *path, *apath; + char *url, *path, *apath, *escaped; const char *uri = a->v; if (g_strcmp0(uri, "") == 0) @@ -580,6 +580,10 @@ loaduri(Client *c, const Arg *a) if (!stat(apath, &st) && (path = realpath(apath, NULL))) { url = g_strdup_printf("file://%s", path); free(path); + } else if (strchr(uri, ' ') || !strchr(uri, '.')) { + escaped = g_uri_escape_string(uri, NULL, TRUE); + url = g_strdup_printf("https://startpage.com/do/search?query=%s", escaped); + g_free(escaped); } else { url = g_strdup_printf("https://%s", uri); } |
