Hi,

When loading a non-reachable URI, surf tries to load it a good number
of times before giving up. I doubt this is intended and it gets really
annoying as you have to browse back several times to reach the
previous page. This tiny patch solves this and removes two (legacy?)
unused pointers from the Client struct.

Regards,
Rafa.
diff -r e83fbd17d63a surf.c
--- a/surf.c    Tue Jun 08 09:06:15 2010 +0200
+++ b/surf.c    Tue Jun 22 13:45:16 2010 +0200
@@ -36,7 +36,6 @@
        GtkWidget *win, *scroll, *vbox, *indicator;
        WebKitWebView *view;
        char *title, *linkhover;
-       const char *uri, *needle;
        gint progress;
        struct Client *next;
        gboolean zoomed;
@@ -383,6 +382,7 @@
 void
 loaduri(Client *c, const Arg *arg) {
        char *u;
+       const char *cururi;
        const char *uri = (char *)arg->v;
        Arg a = { .b = FALSE };
 
@@ -391,7 +391,8 @@
        u = g_strrstr(uri, "://") ? g_strdup(uri)
                : g_strdup_printf("http://%s";, uri);
        /* prevents endless loop */
-       if(c->uri && strcmp(u, c->uri) == 0) {
+       cururi=geturi(c);
+       if(strcmp(u, cururi) == 0) {
                reload(c, &a);
        }
        else {

Reply via email to