summaryrefslogtreecommitdiff
path: root/src/bin/utils.c
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2012-10-09 15:14:24 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2012-10-09 15:14:24 +0000
commit08e164ce10fa25a47fffe0cd32948b5ee2cd27aa (patch)
tree8de97630cc5a165ca078f435022d2b83685ed6b7 /src/bin/utils.c
parent2a0e0fd2b429af5e8ec151ae3e4fe67c4e4f13ef (diff)
casestartswith() macro to help strncasecmp() with static comparison.
SVN revision: 77654
Diffstat (limited to 'src/bin/utils.c')
-rw-r--r--src/bin/utils.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/bin/utils.c b/src/bin/utils.c
index 5a39d22..0e735fa 100644
--- a/src/bin/utils.c
+++ b/src/bin/utils.c
@@ -54,10 +54,10 @@ theme_auto_reload_enable(Evas_Object *edje)
54Eina_Bool 54Eina_Bool
55link_is_protocol(const char *str) 55link_is_protocol(const char *str)
56{ 56{
57 if ((!strncasecmp(str, "http://", 7))|| 57 if (casestartswith(str, "http://") ||
58 (!strncasecmp(str, "https://", 8)) || 58 casestartswith(str, "https://") ||
59 (!strncasecmp(str, "ftp://", 6)) || 59 casestartswith(str, "ftp://") ||
60 (!strncasecmp(str, "file://", 7))) 60 casestartswith(str, "file://"))
61 return EINA_TRUE; 61 return EINA_TRUE;
62 return EINA_FALSE; 62 return EINA_FALSE;
63} 63}
@@ -66,8 +66,8 @@ Eina_Bool
66link_is_url(const char *str) 66link_is_url(const char *str)
67{ 67{
68 if (link_is_protocol(str) || 68 if (link_is_protocol(str) ||
69 (!strncasecmp(str, "www.", 4)) || 69 casestartswith(str, "www.") ||
70 (!strncasecmp(str, "ftp.", 4))) 70 casestartswith(str, "ftp."))
71 return EINA_TRUE; 71 return EINA_TRUE;
72 return EINA_FALSE; 72 return EINA_FALSE;
73} 73}