From 4afdf27f16d59449354dd3b5d71248b750c0a20b Mon Sep 17 00:00:00 2001 From: Jon Trowbridge Date: Tue, 4 Dec 2001 01:31:39 +0000 Subject: Make address comparisons case-insensitive. (Fixes 11776) 2001-12-03 Jon Trowbridge * backend/ebook/e-destination.c (e_destination_equal): Make address comparisons case-insensitive. (Fixes 11776) * backend/ebook/e-card.c (e_card_email_match_single_string): Make address host comparisons case-insensitive. (Fixes 11776) svn path=/trunk/; revision=14856 --- addressbook/backend/ebook/e-card.c | 6 +++--- addressbook/backend/ebook/e-destination.c | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'addressbook/backend') diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c index c98f0dce30..d7f5457326 100644 --- a/addressbook/backend/ebook/e-card.c +++ b/addressbook/backend/ebook/e-card.c @@ -1827,12 +1827,12 @@ e_card_email_match_single_string (const gchar *a, const gchar *b) ++xb; while (match && *xa != '@' && *xb != '@') { - match = (*xa == *xb); + match = (tolower (*xa) == tolower (*xb)); --xa; --xb; } - match = match && ((*xa == *xb) || (*xa == '.') || (*xb == '.')); + match = match && ((tolower (*xa) == tolower (*xb)) || (*xa == '.') || (*xb == '.')); return match; } @@ -1866,7 +1866,7 @@ e_card_email_find_number (const ECard *card, const gchar *email) iter = e_list_get_iterator (card->email); for (e_iterator_reset (iter); e_iterator_is_valid (iter); e_iterator_next (iter)) { - if (!strcmp (e_iterator_get (iter), email)) + if (!g_strcasecmp (e_iterator_get (iter), email)) goto finished; ++count; } diff --git a/addressbook/backend/ebook/e-destination.c b/addressbook/backend/ebook/e-destination.c index 508802b823..b82e616601 100644 --- a/addressbook/backend/ebook/e-destination.c +++ b/addressbook/backend/ebook/e-destination.c @@ -331,11 +331,12 @@ nonempty (const gchar *s) gboolean e_destination_is_empty (const EDestination *dest) + { struct _EDestinationPrivate *p; g_return_val_if_fail (E_IS_DESTINATION (dest), TRUE); p = dest->priv; - + return !(p->card != NULL || (p->book_uri && *p->book_uri) || (p->card_uid && *p->card_uid) @@ -389,10 +390,10 @@ e_destination_equal (const EDestination *a, const EDestination *b) /* Just in case name returns NULL */ na = e_destination_get_name (a); nb = e_destination_get_name (b); - if ((na || nb) && !(na && nb && !strcmp (na, nb))) + if ((na || nb) && !(na && nb && ! g_utf8_strcasecmp (na, nb))) return FALSE; - if (!strcmp (e_destination_get_email (a), e_destination_get_email (b))) + if (!g_strcasecmp (e_destination_get_email (a), e_destination_get_email (b))) return TRUE; return FALSE; -- cgit v1.2.3