From 34a3c307b5a05cc0898fd113a82df1a2dc2c719d Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Thu, 4 Nov 2010 19:03:49 +0100 Subject: [PATCH] Properly omit quotes from -moz-document domain --- extensions/addons.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/extensions/addons.c b/extensions/addons.c index cdbc0a98..229051f2 100644 --- a/extensions/addons.c +++ b/extensions/addons.c @@ -827,14 +827,15 @@ css_metadata_from_file (const gchar* filename, value = g_strdup (parts[i] + strlen ("url(")); if (value) { - guint j; + guint begin, end; gchar* domain; - j = 1; - while (value[j] != '\0' && value[j] != ')') - ++j; + begin = value[0] == '"' || value[0] == '\'' ? 1 : 0; + end = 1; + while (value[end] != '\0' && value[end] != ')') + ++end; - domain = g_strndup (value, j); + domain = g_strndup (value + begin, end - begin * 2); if (!strncmp ("http", domain, 4)) *includes = g_slist_prepend (*includes, domain); else -- 2.39.5