diff options
author | Chyla Zbigniew <chyla@src.gnome.org> | 2001-09-01 05:41:31 +0800 |
---|---|---|
committer | Chyla Zbigniew <chyla@src.gnome.org> | 2001-09-01 05:41:31 +0800 |
commit | 136c97b56d8dc0d2f9e04c27a18647b0dac4ca72 (patch) | |
tree | 8fe2e7b59ead12fc98a0b5c8cf257a0ea387d0d1 | |
parent | 45da22387b198e11d3fc1143a577d41b0803a242 (diff) | |
download | gsoc2013-evolution-136c97b56d8dc0d2f9e04c27a18647b0dac4ca72.tar gsoc2013-evolution-136c97b56d8dc0d2f9e04c27a18647b0dac4ca72.tar.gz gsoc2013-evolution-136c97b56d8dc0d2f9e04c27a18647b0dac4ca72.tar.bz2 gsoc2013-evolution-136c97b56d8dc0d2f9e04c27a18647b0dac4ca72.tar.lz gsoc2013-evolution-136c97b56d8dc0d2f9e04c27a18647b0dac4ca72.tar.xz gsoc2013-evolution-136c97b56d8dc0d2f9e04c27a18647b0dac4ca72.tar.zst gsoc2013-evolution-136c97b56d8dc0d2f9e04c27a18647b0dac4ca72.zip |
Use g_utf8_collate instead of g_strcasecmp for comparing names.
* message-list.c
(e_mail_address_compare): Use g_utf8_collate instead of g_strcasecmp
for comparing names.
(subject_compare): Replaced g_strcasecmp, isspace, var++ with UTF-8
counterparts.
svn path=/trunk/; revision=12541
-rw-r--r-- | mail/ChangeLog | 8 | ||||
-rw-r--r-- | mail/message-list.c | 22 |
2 files changed, 21 insertions, 9 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 5614aa12ff..9a696d5b7f 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,11 @@ +2001-08-28 Zbigniew Chyla <cyba@gnome.pl> + + * message-list.c + (e_mail_address_compare): Use g_utf8_collate instead of g_strcasecmp + for comparing names. + (subject_compare): Replaced g_strcasecmp, isspace, var++ with UTF-8 + counterparts. + 2001-08-30 Iain Holmes <iain@ximian.com> * importer/evolution-mbox-importer.c: (load_file_fn): Check if it's a diff --git a/mail/message-list.c b/mail/message-list.c index a764782ba6..afe9da6086 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -28,6 +28,7 @@ #include <gal/e-table/e-cell-size.h> #include <gal/e-table/e-tree-memory.h> #include <gal/e-table/e-tree-memory-callbacks.h> +#include <gal/unicode/gunicode.h> #include <camel/camel-exception.h> #include <camel/camel-file-utils.h> @@ -229,7 +230,7 @@ e_mail_address_compare (gconstpointer address1, gconstpointer address2) if (!addr2->wname->last) return 1; - retval = g_strcasecmp (addr1->wname->last, addr2->wname->last); + retval = g_utf8_collate (addr1->wname->last, addr2->wname->last); if (retval) return retval; @@ -243,7 +244,7 @@ e_mail_address_compare (gconstpointer address1, gconstpointer address2) if (!addr2->wname->first) return 1; - retval = g_strcasecmp (addr1->wname->first, addr2->wname->first); + retval = g_utf8_collate (addr1->wname->first, addr2->wname->first); if (retval) return retval; @@ -269,7 +270,7 @@ address_compare (gconstpointer address1, gconstpointer address2) e_mail_address_free (addr1); e_mail_address_free (addr2); #else - retval = g_strcasecmp ((const char *) address1, (const char *) address2); + retval = g_utf8_collate ((const char *) address1, (const char *) address2); #endif /* SMART_ADDRESS_COMPARE */ return retval; @@ -289,22 +290,25 @@ subject_compare (gconstpointer subject1, gconstpointer subject2) while (!g_strncasecmp (sub1, "Re:", 3)) { sub1 += 3; /* jump over any spaces */ - for ( ; *sub1 && isspace (*sub1); sub1++); + while (*sub1 && g_unichar_isspace (g_utf8_get_char (sub1))) + sub1 = g_utf8_next_char (sub1); } /* trim off any "Re:"'s at the beginning of subject2 */ sub2 = (char *) subject2; while (!g_strncasecmp (sub2, "Re:", 3)) { sub2 += 3; - /* jump over any spaces */ - for ( ; *sub2 && isspace (*sub2); sub2++); + while (*sub2 && g_unichar_isspace (g_utf8_get_char (sub2))) + sub2 = g_utf8_next_char (sub2); } /* jump over any spaces */ - for ( ; *sub1 && isspace (*sub1); sub1++); - for ( ; *sub2 && isspace (*sub2); sub2++); + while (*sub1 && g_unichar_isspace (g_utf8_get_char (sub1))) + sub1 = g_utf8_next_char (sub1); + while (*sub2 && g_unichar_isspace (g_utf8_get_char (sub2))) + sub2 = g_utf8_next_char (sub2); - return g_strcasecmp (sub1, sub2); + return g_utf8_collate (sub1, sub2); } static gchar * |