Re: SVN searlier than 7994: error while lauching a link from a mail



...and here's the patch.

On Dec  3, 2008, at 12:05 PM, Peter Bloomfield wrote:
On Dec  3, 2008, at  9:59 AM, Jean-Luc Coulon (f5ibh) wrote:
I've tested it.
Same problem...

Regards

J-L


Le 03.12.2008 15:05:08, Peter Bloomfield a écrit :
On 12/03/2008 03:11:07 AM Wed, Jean-Luc Coulon (f5ibh) wrote:
Le 03.12.2008 09:01:54, Jean-Luc Coulon (f5ibh) a écrit :
_______________________________________________


BTW : I've not html rendering problem. The problem is to launch a link to an external browser.

Bests

Jean-Luc

OK, yeah, sorry--my mind was on the WebKit stuff, which also has issues

launching links.

I noticed one problem, handling a link on a quoted line--this seems to fix that one:
[ snip ]
But we also seem to pick up only the first line of a multi-line URI, and I'm not sure what the fix for that should be. More later...

Here's a possible fix for the multi-line issue--could you try it?

Thanks!

Peter
Index: src/balsa-mime-widget-text.c
===================================================================
--- src/balsa-mime-widget-text.c	(revision 8010)
+++ src/balsa-mime-widget-text.c	(working copy)
@@ -327,6 +327,7 @@
 		    new = this_line + cite_idx;
 		    if (g_unichar_isspace(g_utf8_get_char(new)))
 			new = g_utf8_next_char(new);
+                    line_start += new - this_line;
 		    new = g_strdup(new);
 		    g_free(this_line);
 		    this_line = new;
Index: libbalsa/mime.c
===================================================================
--- libbalsa/mime.c	(revision 8010)
+++ libbalsa/mime.c	(working copy)
@@ -990,13 +990,18 @@
 
 	if (url_info->ml_url) {
 	    gchar *url_end = strchr(p, '>');
+            GString *ml_url;
 
+            ml_url = g_string_new(url_info->ml_url);
+            g_free(url_info->ml_url);
+
 	    if (url_end) {
-		url_info->ml_url_buffer =
-		    g_string_append_len(url_info->ml_url_buffer, p, url_end - p);
+                g_string_append_len(url_info->ml_url_buffer, p, url_end - p);
 		gtk_text_buffer_insert_with_tags(buffer, &iter,
 						 url_info->ml_url_buffer->str, -1,
 						 url_tag, tag, NULL);
+                g_string_append_len(ml_url, p, url_end - p);
+                url_info->ml_url = g_string_free(ml_url, FALSE);
 		if (url_info->callback)
 		    url_info->callback(buffer, &iter, url_info->ml_url, url_info->callback_data);
 		g_string_free(url_info->ml_url_buffer, TRUE);
@@ -1005,10 +1010,10 @@
 		url_info->ml_url = NULL;
 		p = url_end;
 	    } else {
-		url_info->ml_url_buffer =
-		    g_string_append(url_info->ml_url_buffer, p);
-		url_info->ml_url_buffer =
-		    g_string_append_c(url_info->ml_url_buffer, '\n');
+                g_string_append(url_info->ml_url_buffer, p);
+                g_string_append_c(url_info->ml_url_buffer, '\n');
+                g_string_append(ml_url, p);
+                url_info->ml_url = g_string_free(ml_url, FALSE);
 		return TRUE;
 	    }
 	}

Attachment: pgpI3FiibX3xK.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]