_SURF_URI gets initialised as soon as the window opens.

This commit is contained in:
Enno Boland (tox) 2010-01-29 09:44:14 +01:00
parent b18189d016
commit 94601622a1

10
surf.c
View file

@ -435,15 +435,24 @@ void
loaduri(Client *c, const Arg *arg) { loaduri(Client *c, const Arg *arg) {
char *u; char *u;
const char *uri = (char *)arg->v; const char *uri = (char *)arg->v;
Arg a = { .b = FALSE };
if(strcmp(uri, "") == 0)
return;
u = g_strrstr(uri, "://") ? g_strdup(uri) u = g_strrstr(uri, "://") ? g_strdup(uri)
: g_strdup_printf("http://%s", uri); : g_strdup_printf("http://%s", uri);
/* prevents endless loop */
if(c->uri && strcmp(u, c->uri) == 0) {
reload(c, &a);
}
else {
webkit_web_view_load_uri(c->view, u); webkit_web_view_load_uri(c->view, u);
c->progress = 0; c->progress = 0;
c->title = copystr(&c->title, u); c->title = copystr(&c->title, u);
g_free(u); g_free(u);
update(c); update(c);
} }
}
void void
navigate(Client *c, const Arg *arg) { navigate(Client *c, const Arg *arg) {
@ -551,6 +560,7 @@ newclient(void) {
g_object_set(G_OBJECT(settings), "user-stylesheet-uri", uri, NULL); g_object_set(G_OBJECT(settings), "user-stylesheet-uri", uri, NULL);
g_free(uri); g_free(uri);
setatom(c, findprop, ""); setatom(c, findprop, "");
setatom(c, uriprop, "");
c->download = NULL; c->download = NULL;
c->title = NULL; c->title = NULL;