From 5bfed09e13d7c966ebd7ec1ba3ea60642f7f6522 Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Tue, 9 Oct 2012 14:50:01 +0000 Subject: [PATCH] just highlight emails with domains containing a period. While a domain "localhost" is valid, it's very annoying as most PS1 prompts are in the form 'user@hostname' and terminology will highlight them. To avoid so just create links for user@hostname.something SVN revision: 77647 --- src/bin/termio.c | 10 +++++++--- src/bin/termiolink.c | 4 +++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/bin/termio.c b/src/bin/termio.c index 0376d87c..f218f5f2 100644 --- a/src/bin/termio.c +++ b/src/bin/termio.c @@ -119,9 +119,13 @@ _activate_link(Evas_Object *obj) path = sd->link.string; if (!strncasecmp(sd->link.string, "file://", 7)) path = path + 7; } - else if (strchr(sd->link.string, '@')) - email = EINA_TRUE; - + else + { + const char *at = strchr(sd->link.string, '@'); + if (at && (strchr(at + 1, '.'))) + email = EINA_TRUE; + } + s = eina_str_escape(sd->link.string); if (!s) return; if (email) diff --git a/src/bin/termiolink.c b/src/bin/termiolink.c index 6d84f19f..86a6628b 100644 --- a/src/bin/termiolink.c +++ b/src/bin/termiolink.c @@ -160,7 +160,9 @@ _termio_link_find(Evas_Object *obj, int cx, int cy, int *x1r, int *y1r, int *x2r } if ((!isspace(s[0])) && (len > 1)) { - if ((strchr(s, '@')) || + const char *at = strchr(s, '@'); + + if ((at && (strchr(at + 1, '.'))) || (!strncasecmp(s, "http://", 7))|| (!strncasecmp(s, "https://", 8)) || (!strncasecmp(s, "ftp://", 6)) ||