sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit daabde5f9dc37868cd0ea347b1a85b479dc262fa
parent 8d97a121ef0725732dcd5ee814d2ad9e19802d6e
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Fri,  9 Aug 2019 16:28:28 +0200

surf searchengines: remove old broken patches

Diffstat:
Msurf.suckless.org/patches/searchengines/index.md | 3---
Dsurf.suckless.org/patches/searchengines/surf-0.1-searchengines.diff | 61-------------------------------------------------------------
Dsurf.suckless.org/patches/searchengines/surf-0.5-searchengines.diff | 52----------------------------------------------------
Dsurf.suckless.org/patches/searchengines/surf-0.6-searchengines.diff | 77-----------------------------------------------------------------------------
4 files changed, 0 insertions(+), 193 deletions(-)

diff --git a/surf.suckless.org/patches/searchengines/index.md b/surf.suckless.org/patches/searchengines/index.md @@ -26,11 +26,8 @@ or: Download -------- -* [surf-0.1-searchengines.diff](surf-0.1-searchengines.diff) (1964) (20090923) * [surf-0.3-searchengines.diff](surf-0.3-searchengines.diff) (2107) (20091204) * [surf-0.4-searchengines.diff](surf-0.4-searchengines.diff) (2107) (20091204) -* [surf-0.5-searchengines.diff](surf-0.5-searchengines.diff) (1611) (20101028) -* [surf-0.6-searchengines.diff](surf-0.6-searchengines.diff) (20130514) * [surf-0.7-searchengines.diff](surf-0.7-searchengines.diff) (20151219) * [surf-git-20160127-searchengines.diff](surf-git-20160127-searchengines.diff) * [surf-0.7-webkit2-searchengines.diff](surf-0.7-webkit2-searchengines.diff) (20160108) diff --git a/surf.suckless.org/patches/searchengines/surf-0.1-searchengines.diff b/surf.suckless.org/patches/searchengines/surf-0.1-searchengines.diff @@ -1,61 +0,0 @@ -diff -r fee97b4579f2 config.def.h ---- a/config.def.h Mon Sep 21 03:27:20 2009 +0200 -+++ b/config.def.h Wed Sep 23 22:58:21 2009 +0200 -@@ -30,3 +30,6 @@ - { 0, GDK_Return, hideurl, { 0 }, UrlBar }, - }; - -+static SearchEngine searchengines[] = { -+ { NULL, NULL }, -+}; -diff -r fee97b4579f2 surf.c ---- a/surf.c Mon Sep 21 03:27:20 2009 +0200 -+++ b/surf.c Wed Sep 23 22:58:21 2009 +0200 -@@ -58,6 +58,11 @@ - KeyFocus focus; - } Key; - -+typedef struct { -+ char *token; -+ char *uri; -+} SearchEngine; -+ - static Display *dpy; - static Atom urlprop; - static SoupCookieJar *cookiejar; -@@ -92,6 +97,7 @@ - static Client *newclient(void); - static WebKitWebView *newwindow(WebKitWebView *v, WebKitWebFrame *f, Client *c); - static void pasteurl(GtkClipboard *clipboard, const gchar *text, gpointer d); -+static gchar *parseuri(const gchar *uri); - static GdkFilterReturn processx(GdkXEvent *xevent, GdkEvent *event, gpointer d); - static void print(Client *c, const Arg *arg); - static void proccookies(SoupMessage *m, Client *c); -@@ -348,14 +354,25 @@ - g_free(uri); - } - -+gchar * -+parseuri(const gchar *uri) { -+ 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); -+ } -+ return g_strrstr(uri, "://") ? g_strdup(uri) : g_strdup_printf("http://%s", uri); -+} -+ - void - loaduri(Client *c, const Arg *arg) { - gchar *u; - const gchar *uri = (gchar *)arg->v; - if(!uri) - uri = gtk_entry_get_text(GTK_ENTRY(c->urlbar)); -- u = g_strrstr(uri, "://") ? g_strdup(uri) -- : g_strdup_printf("http://%s", uri); -+ u = parseuri(uri); - webkit_web_view_load_uri(c->view, u); - c->progress = 0; - c->title = copystr(&c->title, u); diff --git a/surf.suckless.org/patches/searchengines/surf-0.5-searchengines.diff b/surf.suckless.org/patches/searchengines/surf-0.5-searchengines.diff @@ -1,52 +0,0 @@ ---- surf.c 2012-10-26 17:58:18.912014914 +0200 -+++ surf.c 2012-10-27 15:54:06.332317229 +0200 -@@ -68,6 +68,11 @@ - - G_DEFINE_TYPE(CookieJar, cookiejar, SOUP_TYPE_COOKIE_JAR_TEXT) - -+typedef struct { -+ char *token; -+ char *uri; -+} SearchEngine; -+ - static Display *dpy; - static Atom atoms[AtomLast]; - static Client *clients = NULL; -@@ -105,6 +110,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 *); -@@ -475,8 +481,7 @@ - - if(strcmp(uri, "") == 0) - return; -- u = g_strrstr(uri, "://") ? g_strdup(uri) -- : g_strdup_printf("http://%s", uri); -+ u = parseuri(uri); - /* prevents endless loop */ - if(c->uri && strcmp(u, c->uri) == 0) { - reload(c, &a); -@@ -679,6 +684,19 @@ - } - } - -+ -+gchar * -+parseuri(const gchar *uri) { -+ 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); -+ } -+ return g_strrstr(uri, "://") ? g_strdup(uri) : g_strdup_printf("http://%s", uri); -+} -+ - void - pasteuri(GtkClipboard *clipboard, const char *text, gpointer d) { - Arg arg = {.v = text }; diff --git a/surf.suckless.org/patches/searchengines/surf-0.6-searchengines.diff b/surf.suckless.org/patches/searchengines/surf-0.6-searchengines.diff @@ -1,77 +0,0 @@ -diff --git a/config.def.h b/config.def.h -index 93a3d49..4ac7f15 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -75,6 +75,13 @@ static SiteStyle styles[] = { - { ".*", "default.css" }, - }; - -+/* search engines */ -+static SearchEngine searchengines[] = { -+ { "g", "http://www.google.de/search?q=%s" }, -+ { "leo", "http://dict.leo.org/ende?search=%s" }, -+ { "ddg", "https://duckduckgo.com/?q=%s" }, -+}; -+ - #define MODKEY GDK_CONTROL_MASK - - /* hotkeys */ -diff --git a/surf.c b/surf.c -index fdfaab1..b6ac237 100644 ---- a/surf.c -+++ b/surf.c -@@ -91,6 +91,12 @@ typedef struct { - G_DEFINE_TYPE(CookieJar, cookiejar, SOUP_TYPE_COOKIE_JAR_TEXT) - - typedef struct { -+ char *token; -+ char *uri; -+} SearchEngine; -+ -+ -+typedef struct { - char *regex; - char *style; - regex_t re; -@@ -178,6 +184,7 @@ static void loaduri(Client *c, const Arg *arg); - 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 gboolean contextmenu(WebKitWebView *view, GtkWidget *menu, - WebKitHitTestResult *target, gboolean keyboard, -@@ -838,8 +845,7 @@ loaduri(Client *c, const Arg *arg) - 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); - } - - setatom(c, AtomUri, uri); -@@ -1172,7 +1178,22 @@ menuactivate(GtkMenuItem *item, Client *c) - } - } - --void -+static gchar * -+parseuri(const gchar *uri) { -+ 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); -+ } -+ -+ 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 };