summaryrefslogtreecommitdiff
path: root/sd/surf-2.1/surf-0.7-webkit2-searchengines.diff
diff options
context:
space:
mode:
authorstkhan <personal@slickd.xyz>2021-06-19 10:42:51 -0500
committerstkhan <personal@slickd.xyz>2021-06-19 10:42:51 -0500
commit120b0999b4d996f4e9a0d78975f7ef4923b95e7e (patch)
tree8cf3fa8dc6069b1f4cfe6a874be428cb38cb744b /sd/surf-2.1/surf-0.7-webkit2-searchengines.diff
parente2dbb81b9144fd8be2eb89617db38fd361079fed (diff)
Remove tmp dir
Former-commit-id: f9a9e87a5573b8c6549d802405fa53c78ec419b9
Diffstat (limited to 'sd/surf-2.1/surf-0.7-webkit2-searchengines.diff')
-rw-r--r--sd/surf-2.1/surf-0.7-webkit2-searchengines.diff63
1 files changed, 0 insertions, 63 deletions
diff --git a/sd/surf-2.1/surf-0.7-webkit2-searchengines.diff b/sd/surf-2.1/surf-0.7-webkit2-searchengines.diff
deleted file mode 100644
index ef94f53..0000000
--- a/sd/surf-2.1/surf-0.7-webkit2-searchengines.diff
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/surf.c b/surf.c
-index 9b4dbb9..bf54d84 100644
---- a/surf.c
-+++ b/surf.c
-@@ -92,6 +92,12 @@ typedef struct {
- } Button;
-
- typedef struct {
-+ char *token;
-+ char *uri;
-+} SearchEngine;
-+
-+
-+typedef struct {
- char *regex;
- char *style;
- regex_t re;
-@@ -124,6 +130,7 @@ static void newwindow(Client *c, const Arg *a, int noembed);
- static void spawn(Client *c, const Arg *a);
- static void destroyclient(Client *c);
- static void cleanup(void);
-+static gchar *parseuri(const gchar *uri);
-
- /* GTK/WebKit */
- static WebKitWebView *newview(Client *c, WebKitWebView *rv);
-@@ -350,13 +357,13 @@ loaduri(Client *c, const Arg *a)
- if (g_strcmp0(uri, "") == 0)
- return;
-
-- if (g_strrstr(uri, "://") || g_str_has_prefix(uri, "about:")) {
-+ if (g_str_has_prefix(uri, "about:")) {
- url = g_strdup(uri);
- } else if (!stat(uri, &st) && (path = realpath(uri, NULL))) {
- url = g_strdup_printf("file://%s", path);
- free(path);
- } else {
-- url = g_strdup_printf("http://%s", uri);
-+ url = parseuri(uri);
- }
-
- setatom(c, AtomUri, url);
-@@ -1205,6 +1212,21 @@ destroywin(GtkWidget* w, Client *c)
- gtk_main_quit();
- }
-
-+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);
-+}
-+
- void
- pasteuri(GtkClipboard *clipboard, const char *text, gpointer d)
- {