diff options
author | Philip Withnall <philip.withnall@collabora.co.uk> | 2015-06-16 14:15:16 +0100 |
---|---|---|
committer | Philip Withnall <philip@tecnocode.co.uk> | 2015-06-18 23:28:06 +0100 |
commit | 513ac76e68950e78c6898f0703d8055d586bddf2 (patch) | |
tree | 7202d6ed9ee57f49534afffdf1d8060b0128efb0 /addressbook | |
parent | 3738cdcd1b26625ce1a005d0c24b8814c593a7a0 (diff) | |
download | evolution-data-server-513ac76e68950e78c6898f0703d8055d586bddf2.tar.gz |
addressbook: Treat an empty vCard attribute group name as NULL
We do not want the following two calls to behave differently:
e_vcard_attribute_new ("", "X-HELLO")
e_vcard_attribute_new (NULL, "X-HELLO")
Elsewhere in the vCard code, attribute group names are guaranteed to be
NULL or non-empty strings, so we should follow that precedent here.
https://bugzilla.gnome.org/show_bug.cgi?id=751044
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/libebook-contacts/e-vcard.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/addressbook/libebook-contacts/e-vcard.c b/addressbook/libebook-contacts/e-vcard.c index c15faa0aa..e13ee2d56 100644 --- a/addressbook/libebook-contacts/e-vcard.c +++ b/addressbook/libebook-contacts/e-vcard.c @@ -1530,7 +1530,8 @@ e_vcard_dump_structure (EVCard *evc) * @attr_name: an attribute name * * Creates a new #EVCardAttribute with the specified group and - * attribute names. + * attribute names. The @attr_group may be %NULL or the empty string if no + * group is needed. * * Returns: (transfer full): A new #EVCardAttribute. **/ @@ -1542,6 +1543,9 @@ e_vcard_attribute_new (const gchar *attr_group, attr = g_slice_new0 (EVCardAttribute); + if (attr_group != NULL && *attr_group == '\0') + attr_group = NULL; + attr->group = g_strdup (attr_group); attr->name = g_strdup (attr_name); |