From 2474210143e733362bbd48d1b48141e2a8909e46 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 15 Sep 2005 12:43:30 +0000 Subject: [PATCH] Use g_ascii_strncasecmp() instead of strncasecmp(). The strings we are 2005-09-15 Tor Lillqvist * camel-mime-filter-enriched.c (param_parse_colour, enriched_to_html): Use g_ascii_strncasecmp() instead of strncasecmp(). 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 | 10 ++++++---- camel/camel-mime-filter-enriched.c | 13 ++++++------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/camel/ChangeLog b/camel/ChangeLog index bb2b7ae..728e253 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -2,10 +2,12 @@ * broken-date-parser.c (get_wday, get_month) * camel-folder-search.c (check_header) - * camel-http-stream.c (http_connect, http_get_statuscode): 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-http-stream.c (http_connect, http_get_statuscode) + * camel-mime-filter-enriched.c (param_parse_colour, enriched_to_html): + 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-mime-filter-enriched.c b/camel/camel-mime-filter-enriched.c index 357d565..3b3d3b4 100644 --- a/camel/camel-mime-filter-enriched.c +++ b/camel/camel-mime-filter-enriched.c @@ -28,9 +28,8 @@ #include #include -#include - #include "camel-mime-filter-enriched.h" +#include "camel-string-utils.h" /* text/enriched is rfc1896 */ @@ -197,7 +196,7 @@ param_parse_colour (const char *inptr, int inlen) int i; for (i = 0; i < NUM_VALID_COLOURS; i++) { - if (!strncasecmp (inptr, valid_colours[i], inlen)) + if (!g_ascii_strncasecmp (inptr, valid_colours[i], inlen)) return g_strdup (valid_colours[i]); } @@ -406,14 +405,14 @@ enriched_to_html (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespa goto need_input; } - if (!strncasecmp (tag, "nofill>", 7)) { + if (!g_ascii_strncasecmp (tag, "nofill>", 7)) { if ((outptr + 5) < outend) { enriched->nofill++; } else { inptr = tag - 1; goto backup; } - } else if (!strncasecmp (tag, "/nofill>", 8)) { + } else if (!g_ascii_strncasecmp (tag, "/nofill>", 8)) { if ((outptr + 6) < outend) { enriched->nofill--; } else { @@ -445,7 +444,7 @@ enriched_to_html (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespa goto need_input; } - if (strncasecmp (inptr, "", 7) != 0) { + if (g_ascii_strncasecmp (inptr, "", 7) != 0) { /* ignore the enriched command tag... */ inptr -= 1; goto loop; @@ -462,7 +461,7 @@ enriched_to_html (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespa goto need_input; } - if (strncasecmp (inptr, "", 8) != 0) { + if (g_ascii_strncasecmp (inptr, "", 8) != 0) { /* ignore the enriched command tag... */ inptr += 7; goto loop; -- 2.7.4