summaryrefslogtreecommitdiff
path: root/surf.c
diff options
context:
space:
mode:
authorChristoph Lohmann <20h@r-36.net>2012-11-08 22:05:40 +0100
committerChristoph Lohmann <20h@r-36.net>2012-11-08 22:05:40 +0100
commit244dfd3231d989909566727b9e20d10cdff88a20 (patch)
treea2111875aa808d66fd3c42cdb6fa550b075c3a04 /surf.c
parentd44bfb2c314c7aa8c734dd1ecb5b3a0c7566a700 (diff)
downloadsurf-244dfd3231d989909566727b9e20d10cdff88a20.tar.gz
surf-244dfd3231d989909566727b9e20d10cdff88a20.tar.bz2
surf-244dfd3231d989909566727b9e20d10cdff88a20.zip
Fixing the bug of surf loading undefined data in arg.
Diffstat (limited to 'surf.c')
-rw-r--r--surf.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/surf.c b/surf.c
index 07c689e..390eaf0 100644
--- a/surf.c
+++ b/surf.c
@@ -453,8 +453,7 @@ void
linkhover(WebKitWebView *v, const char* t, const char* l, Client *c) {
if(l) {
c->linkhover = copystr(&c->linkhover, l);
- }
- else if(c->linkhover) {
+ } else if(c->linkhover) {
free(c->linkhover);
c->linkhover = NULL;
}
@@ -504,8 +503,7 @@ loaduri(Client *c, const Arg *arg) {
/* prevents endless loop */
if(c->uri && strcmp(u, c->uri) == 0) {
reload(c, &a);
- }
- else {
+ } else {
webkit_web_view_load_uri(c->view, u);
c->progress = 0;
c->title = copystr(&c->title, u);
@@ -905,6 +903,7 @@ update(Client *c) {
gtk_widget_hide_all(c->indicator);
t = g_strdup(c->title);
}
+
gtk_window_set_title(GTK_WINDOW(c->win), t);
g_free(t);
}
@@ -944,6 +943,8 @@ int
main(int argc, char *argv[]) {
Arg arg;
+ memset(&arg, 0, sizeof(arg));
+
/* command line args */
ARGBEGIN {
case 'c':
@@ -985,6 +986,7 @@ main(int argc, char *argv[]) {
newclient();
if(arg.v)
loaduri(clients, &arg);
+
gtk_main();
cleanup();