about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMarco Peereboom <marco@conformal.com>2011-01-12 02:42:17 +0000
committerMarco Peereboom <marco@conformal.com>2011-01-12 02:42:17 +0000
commitc113b28e56b988a9e0e3fd8f94d69a0862b60bee (patch)
treef91f6d80345acd303f1efc2c42561fc5f5aaccec
parent6ccd774b8e49cd7d135829c5ee37139e7ea7cb36 (diff)
downloadxombrero-c113b28e56b988a9e0e3fd8f94d69a0862b60bee.tar.gz
handle 0 sized icons; i think this was a side effect of not canceling the
favicon transfer however it doesn't hurt to check for it and handle it.
-rw-r--r--xxxterm.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/xxxterm.c b/xxxterm.c
index 07388fd..a419b94 100644
--- a/xxxterm.c
+++ b/xxxterm.c
@@ -4555,9 +4555,13 @@ notify_icon_loaded_cb(WebKitWebView *wv, char *uri, struct tab *t)
 	snprintf(file, sizeof file, "%s/%s.ico", cache_dir, name_hash);
 	g_free(name_hash);
 	if (!stat(file, &sb)) {
-		/* XXX make sure the icon is not 0 length */
-		load_favicon(t);
-		return (TRUE);
+		if (sb.st_size > 0) {
+			load_favicon(t);
+			return (TRUE);
+		}
+
+		/* corrupt icon so trash it */
+		unlink(file);
 	}
 
 	dest_uri = g_strdup_printf("file://%s", file);