forked from AuroraMiddleware/gtk
GtkAboutDialog: Fix a corner case of link highlighting
GtkAboutDialog highlights emails written as <...> and urls written as http://... . gnome-terminal manages to put <http://...> into its license text, which sadly confuses the parser into running evolution on http://... Fix things up far enough that <http://...> is now recognized as url, and only the part inside the <> is underlined (for email addresses, we include the <> in the underline).
This commit is contained in:
parent
2fb64cf0e7
commit
00be62546f
@ -2045,14 +2045,14 @@ text_buffer_new (GtkAboutDialog *about,
|
|||||||
r1 = strstr (q0, "http://");
|
r1 = strstr (q0, "http://");
|
||||||
if (r1)
|
if (r1)
|
||||||
{
|
{
|
||||||
r2 = strpbrk (r1, " \n\t");
|
r2 = strpbrk (r1, " \n\t>");
|
||||||
if (!r2)
|
if (!r2)
|
||||||
r2 = strchr (r1, '\0');
|
r2 = strchr (r1, '\0');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
r2 = NULL;
|
r2 = NULL;
|
||||||
|
|
||||||
if (r1 && r2 && (!q1 || !q2 || (r1 < q1)))
|
if (r1 && r2 && (!q1 || !q2 || (r1 <= q1 + 1)))
|
||||||
{
|
{
|
||||||
q1 = r1;
|
q1 = r1;
|
||||||
q2 = r2;
|
q2 = r2;
|
||||||
|
Loading…
Reference in New Issue
Block a user