Use g_ascii_str(n)casecmp() instead of str(n)casecmp(). The strings we are
authorTor Lillqvist <tml@novell.com>
Thu, 15 Sep 2005 12:30:58 +0000 (12:30 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Thu, 15 Sep 2005 12:30:58 +0000 (12:30 +0000)
2005-09-15  Tor Lillqvist  <tml@novell.com>

* camel-folder-search.c (check_header): Use g_ascii_str(n)casecmp()
instead of str(n)casecmp(). The strings we are comparing in these
cases should be just ASCII anyway, so spell it out that we really
do need ASCII casefolding only.

camel/ChangeLog
camel/camel-folder-search.c

index f2297c5..c7805e9 100644 (file)
@@ -1,9 +1,10 @@
 2005-09-15  Tor Lillqvist  <tml@novell.com>
 
-       * broken-date-parser.c (get_wday, get_month): Use
-       g_ascii_strncasecmp() instead of strncasecmp(). The strings we are
-       comparing should be just ASCII anyway, so spell it out that we
-       really do care only for the ASCII bytes.
+       * broken-date-parser.c (get_wday, get_month)
+       * camel-folder-search.c (check_header): Use g_ascii_str(n)casecmp() 
+       instead of str(n)casecmp(). The strings we are comparing in these
+       cases should be just ASCII anyway, so spell it out that we really
+       do need ASCII casefolding only.
 
        * camel-debug.c: Use e_util_pthread_id() to identify threads.
 
index 152682c..99a2b02 100644 (file)
@@ -858,19 +858,19 @@ check_header(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolder
 
                /* only a subset of headers are supported .. */
                headername = argv[0]->value.string;
-               if (!strcasecmp(headername, "subject")) {
+               if (!g_ascii_strcasecmp(headername, "subject")) {
                        header = camel_message_info_subject(search->current);
-               } else if (!strcasecmp(headername, "date")) {
+               } else if (!g_ascii_strcasecmp(headername, "date")) {
                        /* FIXME: not a very useful form of the date */
                        sprintf(strbuf, "%d", (int)camel_message_info_date_sent(search->current));
                        header = strbuf;
-               } else if (!strcasecmp(headername, "from")) {
+               } else if (!g_ascii_strcasecmp(headername, "from")) {
                        header = camel_message_info_from(search->current);
                        type = CAMEL_SEARCH_TYPE_ADDRESS;
-               } else if (!strcasecmp(headername, "to")) {
+               } else if (!g_ascii_strcasecmp(headername, "to")) {
                        header = camel_message_info_to(search->current);
                        type = CAMEL_SEARCH_TYPE_ADDRESS;
-               } else if (!strcasecmp(headername, "cc")) {
+               } else if (!g_ascii_strcasecmp(headername, "cc")) {
                        header = camel_message_info_cc(search->current);
                        type = CAMEL_SEARCH_TYPE_ADDRESS;
                } else if (!g_ascii_strcasecmp(headername, "x-camel-mlist")) {