summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/terminal-util.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/terminal-util.c b/src/terminal-util.c
index d0f1864..3e32a69 100644
--- a/src/terminal-util.c
+++ b/src/terminal-util.c
@@ -754,6 +754,25 @@ char *terminal_util_hyperlink_uri_label (const char *uri)
}
g_free(unidn);
}
+ if (g_ascii_strncasecmp(unesc, "mailto:", 7) == 0)
+ {
+ const char *hostname = strchr(unesc, '@');
+ if (hostname != NULL)
+ {
+ const char *unidn = g_hostname_to_unicode(++hostname);
+ replace_hostname = unidn != NULL && g_ascii_strcasecmp(unidn, hostname) != 0;
+ if (replace_hostname)
+ {
+ char *new_unesc = g_strdup_printf("%.*s%s",
+ (int) (hostname - unesc),
+ unesc,
+ unidn);
+ g_free(unesc);
+ unesc = new_unesc;
+ }
+ g_free(unidn);
+ }
+ }
return unesc;
}