diff options
author | B. Watson <yalhcru@gmail.com> | 2021-10-20 03:06:58 -0400 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2021-10-29 17:07:19 +0700 |
commit | 3a2d309b99b14bc3fcbdc54c1b4c82134ec8b3b0 (patch) | |
tree | 9a99f35b46dceacb996cc7fb6ab1d836914f9f22 /network/surf/patches | |
parent | 10ad4368bd16e95d82b95f7a1050da3f74fb5c46 (diff) |
network/surf: Updated for version 2.1.
Signed-off-by: B. Watson <yalhcru@gmail.com>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/surf/patches')
-rw-r--r-- | network/surf/patches/homepage.diff | 8 | ||||
-rw-r--r-- | network/surf/patches/searchengines.diff | 68 |
2 files changed, 38 insertions, 38 deletions
diff --git a/network/surf/patches/homepage.diff b/network/surf/patches/homepage.diff index 4e130a6e8875f..0e8e680891171 100644 --- a/network/surf/patches/homepage.diff +++ b/network/surf/patches/homepage.diff @@ -1,7 +1,7 @@ -diff -Naur surf-2.0/surf.c surf-2.0.patched/surf.c ---- surf-2.0/surf.c 2017-03-28 12:17:45.000000000 -0400 -+++ surf-2.0.patched/surf.c 2017-06-25 01:33:34.501169322 -0400 -@@ -1751,7 +1751,7 @@ +diff -Naur surf-2.1/surf.c surf-2.1.patched/surf.c +--- surf-2.1/surf.c 2021-05-09 18:34:33.000000000 -0400 ++++ surf-2.1.patched/surf.c 2021-10-20 02:55:17.426198883 -0400 +@@ -2117,7 +2117,7 @@ if (argc > 0) arg.v = argv[0]; else diff --git a/network/surf/patches/searchengines.diff b/network/surf/patches/searchengines.diff index e4577632e0938..7666efbad34ad 100644 --- a/network/surf/patches/searchengines.diff +++ b/network/surf/patches/searchengines.diff @@ -1,70 +1,70 @@ -diff -Naur surf-2.0/config.def.h surf-2.0.patched/config.def.h ---- surf-2.0/config.def.h 2017-03-28 12:17:45.000000000 -0400 -+++ surf-2.0.patched/config.def.h 2017-06-25 02:20:53.529174137 -0400 -@@ -153,6 +153,13 @@ +diff -Naur surf-2.1/config.def.h surf-2.1.patched/config.def.h +--- surf-2.1/config.def.h 2021-05-09 18:34:33.000000000 -0400 ++++ surf-2.1.patched/config.def.h 2021-10-20 02:51:08.497221512 -0400 +@@ -179,6 +179,13 @@ { MODKEY|GDK_SHIFT_MASK, GDK_KEY_m, toggle, { .i = Style } }, }; +static SearchEngine searchengines[] = { + { "d", "https://duckduckgo.com/html/?q=%s" }, + { "g", "https://www.google.com/search?q=%s" }, -+ { "dict", "http://www.thefreedictionary.com/%s" }, -+ { "sb", "http://slackbuilds.org/result/?search=%s&sv=@SLACKVER@" }, ++ { "dict", "https://www.thefreedictionary.com/%s" }, ++ { "sb", "https://slackbuilds.org/result/?search=%s&sv=@SLACKVER@" }, +}; + /* button definitions */ /* target can be OnDoc, OnLink, OnImg, OnMedia, OnEdit, OnBar, OnSel, OnAny */ static Button buttons[] = { -diff -Naur surf-2.0/surf.c surf-2.0.patched/surf.c ---- surf-2.0/surf.c 2017-03-28 12:17:45.000000000 -0400 -+++ surf-2.0.patched/surf.c 2017-06-25 02:04:32.517172473 -0400 -@@ -129,6 +129,11 @@ +diff -Naur surf-2.1/surf.c surf-2.1.patched/surf.c +--- surf-2.1/surf.c 2021-05-09 18:34:33.000000000 -0400 ++++ surf-2.1.patched/surf.c 2021-10-20 02:53:48.600206958 -0400 +@@ -130,6 +130,11 @@ } Button; typedef struct { -+ char *token; -+ char *uri; ++ char *token; ++ char *uri; +} SearchEngine; + +typedef struct { const char *uri; Parameter config[ParameterLast]; regex_t re; -@@ -202,6 +207,7 @@ - static void download(Client *c, WebKitURIResponse *r); +@@ -216,6 +221,7 @@ + Client *c); static void closeview(WebKitWebView *v, Client *c); static void destroywin(GtkWidget* w, Client *c); +static gchar *parseuri(const gchar *uri); /* Hotkeys */ static void pasteuri(GtkClipboard *clipboard, const char *text, gpointer d); -@@ -477,7 +483,7 @@ - url = g_strdup_printf("file://%s", path); - free(path); - } else { -- url = g_strdup_printf("http://%s", uri); -+ url = parseuri(uri); - } - - setatom(c, AtomUri, url); -@@ -1461,6 +1467,22 @@ +@@ -576,7 +582,7 @@ + url = g_strdup_printf("file://%s", path); + free(path); + } else { +- url = g_strdup_printf("http://%s", uri); ++ url = parseuri(uri); + } + if (apath != uri) + free(apath); +@@ -1776,6 +1782,22 @@ gtk_main_quit(); } +gchar * +parseuri(const gchar *uri) { -+ guint i; ++ guint i; + -+ for (i = 0; i < LENGTH(searchengines); i++) { -+ if (searchengines[i].token == NULL || searchengines[i].uri == NULL || -+ *(uri + strlen(searchengines[i].token)) != ' ') -+ continue; -+ if (g_str_has_prefix(uri, searchengines[i].token)) -+ return g_strdup_printf(searchengines[i].uri, -+ uri + strlen(searchengines[i].token) + 1); -+ } ++ for (i = 0; i < LENGTH(searchengines); i++) { ++ if (searchengines[i].token == NULL || searchengines[i].uri == NULL || ++ *(uri + strlen(searchengines[i].token)) != ' ') ++ continue; ++ if (g_str_has_prefix(uri, searchengines[i].token)) ++ return g_strdup_printf(searchengines[i].uri, ++ uri + strlen(searchengines[i].token) + 1); ++ } + -+ return g_strdup_printf("http://%s", uri); ++ return g_strdup_printf("http://%s", uri); +} + void |