[Commits] [SCM] claws branch, master, updated. 3.13.0-49-g967a512

ticho at claws-mail.org ticho at claws-mail.org
Wed Nov 11 21:42:59 CET 2015


The branch, master has been updated
       via  967a512bbcf98c5206bd8992f00a0de509174c0b (commit)
      from  e6e769570534a85a35a5201ffa0b74149904539c (commit)

Summary of changes:
 src/common/utils.c |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)


- Log -----------------------------------------------------------------
commit 967a512bbcf98c5206bd8992f00a0de509174c0b
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Wed Nov 11 21:42:16 2015 +0100

    Do not add mailto: prefix for URIs with protocol part.
    
    Closes bug #3562.

diff --git a/src/common/utils.c b/src/common/utils.c
index f16c00b..d67017a 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -4525,10 +4525,21 @@ gchar *make_email_string(const gchar *bp, const gchar *ep)
 	 * uri type later on in the button_pressed signal handler */
 	gchar *tmp;
 	gchar *result;
+	gchar *colon, *at;
 
 	tmp = g_strndup(bp, ep - bp);
-	result = g_strconcat("mailto:", tmp, NULL);
-	g_free(tmp);
+
+	/* If there is a colon in the username part of the address,
+	 * we're dealing with an URI for some other protocol - do
+	 * not prefix with mailto: in such case. */
+	colon = strchr(tmp, ':');
+	at = strchr(tmp, '@');
+	if (colon != NULL && at != NULL && colon < at) {
+		result = tmp;
+	} else {
+		result = g_strconcat("mailto:", tmp, NULL);
+		g_free(tmp);
+	}
 
 	return result;
 }

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list