From cefcb42eef2eacc5bedbde45497535ce3e0481c7 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sat, 25 Oct 2008 16:16:48 +0200 Subject: [PATCH] Recognize favicons in domains with no trailing slash --- katze/katze-net.c | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/katze/katze-net.c b/katze/katze-net.c index 23a0d258..be7b7088 100644 --- a/katze/katze-net.c +++ b/katze/katze-net.c @@ -489,25 +489,28 @@ katze_net_load_icon (KatzeNet* net, icon_uri = g_strdup (uri); icon_uri[i] = '\0'; icon_uri = g_strdup_printf ("%s/favicon.ico", icon_uri); - icon_file = katze_net_get_cached_path (net, icon_uri, "icons"); - - if (g_file_test (icon_file, G_FILE_TEST_EXISTS)) - pixbuf = gdk_pixbuf_new_from_file (icon_file, NULL); - else - { - priv = g_new0 (KatzeNetIconPriv, 1); - priv->net = net; - priv->icon_file = icon_file; - priv->icon_cb = icon_cb; - priv->widget = g_object_ref (widget); - priv->user_data = user_data; - - katze_net_load_uri (net, icon_uri, - (KatzeNetStatusCb)katze_net_icon_status_cb, - (KatzeNetTransferCb)katze_net_icon_transfer_cb, priv); - } - g_free (icon_uri); } + else + icon_uri = g_strdup_printf ("%s/favicon.ico", uri); + + icon_file = katze_net_get_cached_path (net, icon_uri, "icons"); + + if (g_file_test (icon_file, G_FILE_TEST_EXISTS)) + pixbuf = gdk_pixbuf_new_from_file (icon_file, NULL); + else + { + priv = g_new0 (KatzeNetIconPriv, 1); + priv->net = net; + priv->icon_file = icon_file; + priv->icon_cb = icon_cb; + priv->widget = g_object_ref (widget); + priv->user_data = user_data; + + katze_net_load_uri (net, icon_uri, + (KatzeNetStatusCb)katze_net_icon_status_cb, + (KatzeNetTransferCb)katze_net_icon_transfer_cb, priv); + } + g_free (icon_uri); } if (!pixbuf) -- 2.39.5