From 83c6cdd9fc314c68cd258ba90bd357d4b5e2a2b4 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 15 Sep 2005 12:30:58 +0000 Subject: [PATCH] Use g_ascii_str(n)casecmp() instead of str(n)casecmp(). The strings we are 2005-09-15 Tor Lillqvist * 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 | 9 +++++---- camel/camel-folder-search.c | 10 +++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/camel/ChangeLog b/camel/ChangeLog index f2297c5..c7805e9 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,9 +1,10 @@ 2005-09-15 Tor Lillqvist - * 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. diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c index 152682c..99a2b02 100644 --- a/camel/camel-folder-search.c +++ b/camel/camel-folder-search.c @@ -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")) { -- 2.7.4