aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2005-09-28 18:16:34 +0800
committerTor Lillqvist <tml@src.gnome.org>2005-09-28 18:16:34 +0800
commitb105af8066f642a40230adc5803fd458c0737c39 (patch)
tree6c874fd4999ce97143aa10e6bf891ef58791858b
parentbb1c36c74db8723120846cd74207cf4df1c127bc (diff)
downloadgsoc2013-evolution-b105af8066f642a40230adc5803fd458c0737c39.tar
gsoc2013-evolution-b105af8066f642a40230adc5803fd458c0737c39.tar.gz
gsoc2013-evolution-b105af8066f642a40230adc5803fd458c0737c39.tar.bz2
gsoc2013-evolution-b105af8066f642a40230adc5803fd458c0737c39.tar.lz
gsoc2013-evolution-b105af8066f642a40230adc5803fd458c0737c39.tar.xz
gsoc2013-evolution-b105af8066f642a40230adc5803fd458c0737c39.tar.zst
gsoc2013-evolution-b105af8066f642a40230adc5803fd458c0737c39.zip
Use g_ascii_strncasecmp() instead of strncasecmp(). We are comparing to
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. svn path=/trunk/; revision=30395
-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) {