diff options
| author | Philip Withnall <philip.withnall@collabora.co.uk> | 2013-11-23 08:39:01 -0500 |
|---|---|---|
| committer | Matthew Barnes <mbarnes@redhat.com> | 2013-11-23 08:39:31 -0500 |
| commit | 88240da1b6e1c39801c4de19d91e79dee205d842 (patch) | |
| tree | bf887f5e1a77853e9b59d3f2a5004309c368efad /addressbook | |
| parent | 26eb7865458c59d38c82efb853611f9e7250cb3d (diff) | |
| download | evolution-data-server-88240da1b6e1c39801c4de19d91e79dee205d842.tar.gz | |
e-vcard: Fix case sensitivity of string comparisions
The rest of the code (and the specification) uniformly users
case-insensitive comparisons of attribute names and parameter values.
Diffstat (limited to 'addressbook')
| -rw-r--r-- | addressbook/libebook-contacts/e-vcard.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/addressbook/libebook-contacts/e-vcard.c b/addressbook/libebook-contacts/e-vcard.c index 4f4725362..98bded624 100644 --- a/addressbook/libebook-contacts/e-vcard.c +++ b/addressbook/libebook-contacts/e-vcard.c @@ -1575,7 +1575,8 @@ e_vcard_append_attribute (EVCard *evc, /* Handle UID special case: * No need to parse the vcard to append an UID attribute */ - if (evc->priv->vcard != NULL && g_strcmp0 (attr->name, EVC_UID) == 0) { + if (evc->priv->vcard != NULL && attr->name != NULL && + g_ascii_strcasecmp (attr->name, EVC_UID) == 0) { evc->priv->attributes = g_list_append (evc->priv->attributes, attr); } else { evc->priv->attributes = g_list_append (e_vcard_ensure_attributes (evc), attr); @@ -1655,7 +1656,8 @@ e_vcard_add_attribute (EVCard *evc, /* Handle UID special case: * No need to parse the vcard to append an UID attribute */ - if (evc->priv->vcard != NULL && g_strcmp0 (attr->name, EVC_UID) == 0) { + if (evc->priv->vcard != NULL && attr->name != NULL && + g_ascii_strcasecmp (attr->name, EVC_UID) == 0) { evc->priv->attributes = g_list_prepend (evc->priv->attributes, attr); } else { evc->priv->attributes = g_list_prepend (e_vcard_ensure_attributes (evc), attr); @@ -2220,7 +2222,7 @@ e_vcard_attribute_remove_param_value (EVCardAttribute *attr, for (l = params; l; l = l->next) { param = l->data; if (g_ascii_strcasecmp (e_vcard_attribute_param_get_name (param), param_name) == 0) { - l = g_list_find_custom (param->values, s, (GCompareFunc) strcmp); + l = g_list_find_custom (param->values, s, (GCompareFunc) g_ascii_strcasecmp); if (l == NULL) { return; } |
