Handle single, double and absent quotes in -moz-document

This commit is contained in:
Paweł Forysiuk 2010-11-03 00:12:05 +01:00 committed by Christian Dywan
parent cd69cdedb9
commit 53a205be4d

View file

@ -830,27 +830,11 @@ css_metadata_from_file (const gchar* filename,
guint j; guint j;
gchar* domain; gchar* domain;
if (value[0] != '\'' && value[0] != '"')
{
/* Wrong syntax, abort */
g_free (value);
g_strfreev (parts);
g_free (line);
g_io_channel_shutdown (channel, false, 0);
g_slist_free (*includes);
g_slist_free (*excludes);
*includes = NULL;
*excludes = NULL;
return FALSE;
}
j = 1; j = 1;
while (value[j] != '\0') while (value[j] != '\0' && value[j] != ')')
{ ++j;
if (value[j] == value[0])
break; domain = g_strndup (value, j);
j++;
}
domain = g_strndup (value + 1, j - 1);
if (!strncmp ("http", domain, 4)) if (!strncmp ("http", domain, 4))
*includes = g_slist_prepend (*includes, domain); *includes = g_slist_prepend (*includes, domain);
else else