From b105af8066f642a40230adc5803fd458c0737c39 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 28 Sep 2005 10:16:34 +0000 Subject: Use g_ascii_strncasecmp() instead of strncasecmp(). We are comparing to 2005-09-28 Tor Lillqvist * e-html-utils.c (e_text_to_html_full): Use g_ascii_strncasecmp() instead of strncasecmp(). We are comparing to literal ASCII strings, just casefolding ASCII is enough. Also better for portability. svn path=/trunk/; revision=30395 --- e-util/e-html-utils.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'e-util/e-html-utils.c') diff --git a/e-util/e-html-utils.c b/e-util/e-html-utils.c index 535d772dc4..c79e8f8a92 100644 --- a/e-util/e-html-utils.c +++ b/e-util/e-html-utils.c @@ -264,22 +264,22 @@ e_text_to_html_full (const char *input, unsigned int flags, guint32 color) (flags & E_TEXT_TO_HTML_CONVERT_URLS)) { char *tmpurl = NULL, *refurl = NULL, *dispurl = NULL; - if (!strncasecmp (cur, "http://", 7) || - !strncasecmp (cur, "https://", 8) || - !strncasecmp (cur, "ftp://", 6) || - !strncasecmp (cur, "nntp://", 7) || - !strncasecmp (cur, "mailto:", 7) || - !strncasecmp (cur, "news:", 5) || - !strncasecmp (cur, "file:", 5) || - !strncasecmp (cur, "callto:", 7) || - !strncasecmp (cur, "h323:", 5) || - !strncasecmp (cur, "webcal:", 7)) { + if (!g_ascii_strncasecmp (cur, "http://", 7) || + !g_ascii_strncasecmp (cur, "https://", 8) || + !g_ascii_strncasecmp (cur, "ftp://", 6) || + !g_ascii_strncasecmp (cur, "nntp://", 7) || + !g_ascii_strncasecmp (cur, "mailto:", 7) || + !g_ascii_strncasecmp (cur, "news:", 5) || + !g_ascii_strncasecmp (cur, "file:", 5) || + !g_ascii_strncasecmp (cur, "callto:", 7) || + !g_ascii_strncasecmp (cur, "h323:", 5) || + !g_ascii_strncasecmp (cur, "webcal:", 7)) { tmpurl = url_extract (&cur, TRUE); if (tmpurl) { refurl = e_text_to_html (tmpurl, 0); dispurl = g_strdup (refurl); } - } else if (!strncasecmp (cur, "www.", 4) && + } else if (!g_ascii_strncasecmp (cur, "www.", 4) && is_url_char (*(cur + 4))) { tmpurl = url_extract (&cur, FALSE); if (tmpurl) { -- cgit v1.2.3