changeset: 390:1f2408c9e784
tag: tip
user: Samuel Baldwin <recursive.forest_AT_gmail.com>
date: Fri Dec 04 11:09:01 2009 -0500
files: surf.suckless.org/patches/searchengines-0.1.diff surf.suckless.org/patches/searchengines.md surf.suckless.org/patches/surf-0.1-searchengines.diff
description:
Moved old searchengines patch to match naming conventions.
diff -r 90aca9b402a6 -r 1f2408c9e784 surf.suckless.org/patches/searchengines-0.1.diff
--- a/surf.suckless.org/patches/searchengines-0.1.diff Fri Dec 04 11:05:17 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
_AT_@ -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
-_AT_@ -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
-_AT_@ -58,6 +58,11 @@
- KeyFocus focus;
- } Key;
-
-+typedef struct {
-+ char *token;
-+ char *uri;
-+} SearchEngine;
-+
- static Display *dpy;
- static Atom urlprop;
- static SoupCookieJar *cookiejar;
-_AT_@ -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);
-_AT_@ -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 -r 90aca9b402a6 -r 1f2408c9e784 surf.suckless.org/patches/searchengines.md
--- a/surf.suckless.org/patches/searchengines.md Fri Dec 04 11:05:17 2009 -0500
+++ b/surf.suckless.org/patches/searchengines.md Fri Dec 04 11:09:01 2009 -0500
_AT_@ -24,7 +24,7 @@
Download
--------
-* [searchengines-0.1.diff](searchengines-0.1.diff) (4K) (20090923)
+* [surf-0.1-searchengines.diff](surf-0.1-searchengines.diff) (1964) (20090923)
* [surf-0.3-searchengines.diff](surf-0.3-searchengines.diff) (2107) (20091204)
Author
diff -r 90aca9b402a6 -r 1f2408c9e784 surf.suckless.org/patches/surf-0.1-searchengines.diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/surf.suckless.org/patches/surf-0.1-searchengines.diff Fri Dec 04 11:09:01 2009 -0500
_AT_@ -0,0 +1,61 @@
+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
+_AT_@ -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
+_AT_@ -58,6 +58,11 @@
+ KeyFocus focus;
+ } Key;
+
++typedef struct {
++ char *token;
++ char *uri;
++} SearchEngine;
++
+ static Display *dpy;
+ static Atom urlprop;
+ static SoupCookieJar *cookiejar;
+_AT_@ -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);
+_AT_@ -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);
Received on Fri Dec 04 2009 - 17:09:09 CET