aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--e-util/ChangeLog7
-rw-r--r--e-util/e-html-utils.c22
2 files changed, 18 insertions, 11 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index a08591e041..059f7b1f9b 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,3 +1,10 @@
+2005-09-28 Tor Lillqvist <tml@novell.com>
+
+ * 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.
+
2005-08-23 Not Zed <NotZed@Ximian.com>
* e-util.c (e_mkdir_hier): cast warning, good ol win32 patches.
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) {