Correctly skip link items if there is no |

Parsing will still ignore items containing a , anywhere.
This commit is contained in:
Christian Dywan 2012-03-11 21:38:02 +01:00
parent 7066679bcf
commit c6bdd62f67

View file

@ -1488,6 +1488,7 @@ webkit_web_view_load_finished_cb (WebKitWebView* web_view,
"} return f; })(" "} return f; })("
"document.getElementsByTagName ('link'));", NULL); "document.getElementsByTagName ('link'));", NULL);
/* FIXME: If URI or title contains , parsing will break */
gchar** items = g_strsplit (value, ",", 0); gchar** items = g_strsplit (value, ",", 0);
gchar** current_item = items; gchar** current_item = items;
gchar* default_uri = NULL; gchar* default_uri = NULL;
@ -1511,7 +1512,7 @@ webkit_web_view_load_finished_cb (WebKitWebView* web_view,
continue; continue;
title = strchr (uri_and_title, '|'); title = strchr (uri_and_title, '|');
if (title == NULL) if (title == NULL)
continue; goto news_feeds_continue;
title++; title++;
uri = g_strndup (uri_and_title, title - 1 - uri_and_title); uri = g_strndup (uri_and_title, title - 1 - uri_and_title);
@ -1529,6 +1530,7 @@ webkit_web_view_load_finished_cb (WebKitWebView* web_view,
katze_assign (view->icon_uri, g_strdup (uri_and_title)); katze_assign (view->icon_uri, g_strdup (uri_and_title));
#endif #endif
news_feeds_continue:
current_item++; current_item++;
} }
g_strfreev (items); g_strfreev (items);