Recognize effectively empty prefixes of a stylesheet
This commit is contained in:
parent
4440d25e11
commit
9f37c58013
1 changed files with 22 additions and 0 deletions
|
@ -1070,6 +1070,28 @@ css_metadata_from_file (const gchar* filename,
|
||||||
g_io_channel_shutdown (channel, false, 0);
|
g_io_channel_shutdown (channel, false, 0);
|
||||||
g_io_channel_unref (channel);
|
g_io_channel_unref (channel);
|
||||||
|
|
||||||
|
if (*includes != NULL)
|
||||||
|
{
|
||||||
|
/* Styles may have a whitelist even though it is as good as none.
|
||||||
|
It's more efficient if we avoid that. */
|
||||||
|
GSList* list = *includes;
|
||||||
|
gboolean effectively_empty = TRUE;
|
||||||
|
while (list != NULL)
|
||||||
|
{
|
||||||
|
if (!g_str_has_suffix (list->data, "://"))
|
||||||
|
{
|
||||||
|
effectively_empty = FALSE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
list = g_slist_next (list);
|
||||||
|
}
|
||||||
|
if (effectively_empty)
|
||||||
|
{
|
||||||
|
g_slist_free (list);
|
||||||
|
*includes = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue