[Commits] textview.c 1.96.2.252 1.96.2.253

colin at claws-mail.org colin at claws-mail.org
Thu Oct 25 12:19:39 CEST 2012


Update of /home/claws-mail/claws/src
In directory srv:/tmp/cvs-serv25502/src

Modified Files:
      Tag: gtk2
	textview.c 
Log Message:
2012-10-25 [colin]	3.8.1cvs107

	* src/textview.c
		Verify the previous URI wasn't the same...
		fixes http://www. URIs.

Index: textview.c
===================================================================
RCS file: /home/claws-mail/claws/src/textview.c,v
retrieving revision 1.96.2.252
retrieving revision 1.96.2.253
diff -u -d -r1.96.2.252 -r1.96.2.253
--- textview.c	25 Oct 2012 07:44:59 -0000	1.96.2.252
+++ textview.c	25 Oct 2012 10:19:36 -0000	1.96.2.253
@@ -1388,11 +1388,18 @@
 	/* colorize this line */
 	if (head.next) {
 		const gchar *normal_text = mybuf;
+		struct txtpos *previous = NULL;
 
 		/* insert URIs */
 		for (last = head.next; last != NULL;
 		     normal_text = last->ep, last = last->next) {
 			ClickableText *uri;
+
+			if (previous != NULL
+			    && previous->bp < last->bp 
+			    && previous->ep == last->ep)
+				continue;
+
 			uri = g_new0(ClickableText, 1);
 			if (last->bp - normal_text > 0)
 				gtk_text_buffer_insert_with_tags_by_name
@@ -1410,6 +1417,7 @@
 			uri->filename = NULL;
 			textview->uri_list =
 				g_slist_prepend(textview->uri_list, uri);
+			previous = last;
 		}
 
 		if (*normal_text)
@@ -1501,12 +1509,19 @@
 
 	/* colorize this line */
 	if (head.next) {
+		struct txtpos *previous = NULL;
 		/* insert URIs */
 		for (last = head.next; last != NULL; last = last->next) {
 			ClickableText *uri;
 			gint start_offset, end_offset;
 			gchar *tmp_str;
 			gchar old_char;
+
+			if (previous != NULL
+			    && previous->bp < last->bp 
+			    && previous->ep == last->ep)
+				continue;
+
 			uri = g_new0(ClickableText, 1);
 			uri->uri = parser[last->pti].build_uri(last->bp,
 							       last->ep);
@@ -1533,6 +1548,7 @@
 			uri->filename = NULL;
 			textview->uri_list =
 				g_slist_prepend(textview->uri_list, uri);
+			previous = last;
 		}
 	} 
 



More information about the Commits mailing list