about summary refs log tree commit diff stats
path: root/xombrero.c
diff options
context:
space:
mode:
authorMichal Mazurek <akfaew@jasminek.net>2012-06-06 17:31:44 +0200
committerMichal Mazurek <akfaew@jasminek.net>2012-06-06 17:31:44 +0200
commit1c7e8125fad4f52d6db3a9d61b5b625ca73a57ad (patch)
treeea20b653b642862d160424e6231112d09431bbb1 /xombrero.c
parent50031ae7b9de66a0fcbf178e5d3f4d33c4a9c068 (diff)
downloadxombrero-1c7e8125fad4f52d6db3a9d61b5b625ca73a57ad.tar.gz
Fix a bug that made the statusbar display "Loading: ..." even after the
page has been loaded (caused by hovering over links)

Minor style fix (add space).

Fix memleak, t->status was not freed.

OK marco
Diffstat (limited to 'xombrero.c')
-rw-r--r--xombrero.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/xombrero.c b/xombrero.c
index 030ce49..b534f5b 100644
--- a/xombrero.c
+++ b/xombrero.c
@@ -496,19 +496,20 @@ set_status(struct tab *t, gchar *s, int status)
 		break;
 	case XT_STATUS_LINK:
 		type = g_strdup_printf("Link: %s", s);
+		s = type;
 		if (!t->status)
 			t->status = g_strdup(gtk_entry_get_text(
 			    GTK_ENTRY(t->sbe.statusbar)));
-		s = type;
 		break;
 	case XT_STATUS_URI:
 		type = g_strdup_printf("%s", s);
-		if (!t->status) {
-			t->status = g_strdup(type);
-		}
 		s = type;
 		if (!t->status)
 			t->status = g_strdup(s);
+		else if (strcmp(t->status, s)) {
+			g_free(t->status);
+			t->status = g_strdup(s);
+		}
 		break;
 	case XT_STATUS_NOTHING:
 		/* FALL THROUGH */
@@ -874,7 +875,7 @@ get_uri(struct tab *t)
 		/* use tmp_uri to make sure it is g_freed */
 		if (t->tmp_uri)
 			g_free(t->tmp_uri);
-		t->tmp_uri =g_strdup_printf("%s%s", XT_URI_ABOUT,
+		t->tmp_uri = g_strdup_printf("%s%s", XT_URI_ABOUT,
 		    about_list[t->xtp_meaning].name);
 		uri = t->tmp_uri;
 	}
@@ -6808,6 +6809,7 @@ delete_tab(struct tab *t)
 	g_free(t->user_agent);
 	g_free(t->stylesheet);
 	g_free(t->tmp_uri);
+	g_free(t->status);
 	g_free(t);
 	t = NULL;