network: Don't include spaces in proxy's ignore-hosts setting
We should also ignore any zero length strings resulting from g_strsplit_set(). https://bugzilla.gnome.org/show_bug.cgi?id=707966
This commit is contained in:
parent
5f21f92f7f
commit
fb74444eec
1 changed files with 11 additions and 5 deletions
|
@ -285,16 +285,22 @@ set_ignore_hosts (const GValue *value,
|
||||||
const GVariantType *expected_type,
|
const GVariantType *expected_type,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GVariant *result;
|
GVariantBuilder builder;
|
||||||
const gchar *sv;
|
const gchar *sv;
|
||||||
gchar **av;
|
gchar **av, **p;
|
||||||
|
|
||||||
sv = g_value_get_string (value);
|
sv = g_value_get_string (value);
|
||||||
av = g_strsplit (sv, ",", 0);
|
av = g_strsplit_set (sv, ", ", 0);
|
||||||
result = g_variant_new_strv ((const gchar * const *)av, -1);
|
|
||||||
|
g_variant_builder_init (&builder, G_VARIANT_TYPE_STRING_ARRAY);
|
||||||
|
for (p = av; *p; ++p) {
|
||||||
|
if (*p[0] != '\0')
|
||||||
|
g_variant_builder_add (&builder, "s", *p);
|
||||||
|
}
|
||||||
|
|
||||||
g_strfreev (av);
|
g_strfreev (av);
|
||||||
|
|
||||||
return result;
|
return g_variant_builder_end (&builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Add table
Reference in a new issue