summaryrefslogtreecommitdiffstats
path: root/network/surf/patches/searchengines.diff
diff options
context:
space:
mode:
author B. Watson <yalhcru@gmail.com>2017-01-21 22:09:53 -0500
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2017-01-24 07:23:25 +0700
commit023ef991d2dacc69747d7335db1299edaa16d201 (patch)
treef58e39dd03d0bb58857d37ad382c154e4197fad6 /network/surf/patches/searchengines.diff
parentdf6bba04a4e329f85d0f0ea1b035bf5114fa7efe (diff)
downloadslackbuilds-023ef991d2dacc69747d7335db1299edaa16d201.tar.gz
slackbuilds-023ef991d2dacc69747d7335db1299edaa16d201.tar.xz
network/surf: Updated for version 0.7.
Diffstat (limited to 'network/surf/patches/searchengines.diff')
-rw-r--r--network/surf/patches/searchengines.diff79
1 files changed, 42 insertions, 37 deletions
diff --git a/network/surf/patches/searchengines.diff b/network/surf/patches/searchengines.diff
index 97aa6a4922..77ad9deb80 100644
--- a/network/surf/patches/searchengines.diff
+++ b/network/surf/patches/searchengines.diff
@@ -1,8 +1,8 @@
-diff -Naur surf-0.6/config.def.h surf-0.6.patched/config.def.h
---- surf-0.6/config.def.h 2013-02-10 13:40:14.000000000 -0500
-+++ surf-0.6.patched/config.def.h 2013-07-03 16:40:14.000000000 -0400
-@@ -93,3 +93,10 @@
- { MODKEY|GDK_SHIFT_MASK,GDK_v, toggle, { .v = "enable-plugins" } },
+diff -Naur surf-0.7/config.def.h surf-0.7.patched/config.def.h
+--- surf-0.7/config.def.h 2015-12-19 09:59:30.000000000 -0500
++++ surf-0.7.patched/config.def.h 2017-01-21 22:05:50.709360322 -0500
+@@ -129,6 +129,14 @@
+ { MODKEY|GDK_SHIFT_MASK,GDK_g, togglegeolocation, { 0 } },
};
+static SearchEngine searchengines[] = {
@@ -12,58 +12,63 @@ diff -Naur surf-0.6/config.def.h surf-0.6.patched/config.def.h
+ { "sb", "http://slackbuilds.org/result/?search=%s&sv=@SLACKVER@" },
+ { "sw", "http://search.slackware.eu/cgi-bin/search.cgi?rm=search&needle=%s&haystack=2&sver=@SVER@&button-search=Search" },
+};
-diff -Naur surf-0.6/surf.c surf-0.6.patched/surf.c
---- surf-0.6/surf.c 2013-02-10 13:40:14.000000000 -0500
-+++ surf-0.6.patched/surf.c 2013-07-03 15:25:44.000000000 -0400
-@@ -76,6 +76,11 @@
-
++
+ /* button definitions */
+ /* click can be ClkDoc, ClkLink, ClkImg, ClkMedia, ClkSel, ClkEdit, ClkAny */
+ static Button buttons[] = {
+diff -Naur surf-0.7/surf.c surf-0.7.patched/surf.c
+--- surf-0.7/surf.c 2015-12-19 09:59:30.000000000 -0500
++++ surf-0.7.patched/surf.c 2017-01-21 22:05:12.304360777 -0500
+@@ -91,6 +91,12 @@
G_DEFINE_TYPE(CookieJar, cookiejar, SOUP_TYPE_COOKIE_JAR_TEXT)
-+typedef struct {
-+ char *token;
-+ char *uri;
+ typedef struct {
++ char *token;
++ char *uri;
+} SearchEngine;
+
- static Display *dpy;
- static Atom atoms[AtomLast];
- static Client *clients = NULL;
-@@ -139,6 +144,7 @@
++
++typedef struct {
+ char *regex;
+ char *style;
+ regex_t re;
+@@ -178,6 +184,7 @@
static void navigate(Client *c, const Arg *arg);
static Client *newclient(void);
static void newwindow(Client *c, const Arg *arg, gboolean noembed);
+static gchar *parseuri(const gchar *uri);
static void pasteuri(GtkClipboard *clipboard, const char *text, gpointer d);
- static void populatepopup(WebKitWebView *web, GtkMenu *menu, Client *c);
- static void popupactivate(GtkMenuItem *menu, Client *);
-@@ -627,8 +633,8 @@
+ static gboolean contextmenu(WebKitWebView *view, GtkWidget *menu,
+ WebKitHitTestResult *target, gboolean keyboard,
+@@ -838,8 +845,7 @@
u = g_strdup_printf("file://%s", rp);
free(rp);
} else {
- u = g_strrstr(uri, "://") ? g_strdup(uri)
-- : g_strdup_printf("http://%s", uri);
-+ u = parseuri(uri);
-+
+- : g_strdup_printf("http://%s", uri);
++ u = parseuri(uri);
}
- /* prevents endless loop */
-@@ -893,6 +899,20 @@
+ setatom(c, AtomUri, uri);
+@@ -1172,6 +1178,21 @@
}
}
-+gchar *
++static 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_strrstr(uri, "://") ? g_strdup(uri) : g_strdup_printf("http://%s", uri);
++ return g_strrstr(uri, "://") ? g_strdup(uri) : g_strdup_printf("http://%s", uri);
+}
+
- static void
- pasteuri(GtkClipboard *clipboard, const char *text, gpointer d) {
- Arg arg = {.v = text };
+ void
+ pasteuri(GtkClipboard *clipboard, const char *text, gpointer d)
+ {