2006-10-11 [paul] 2.5.3cvs32
authorPaul Mangan <paul@claws-mail.org>
Wed, 11 Oct 2006 08:47:22 +0000 (08:47 +0000)
committerPaul Mangan <paul@claws-mail.org>
Wed, 11 Oct 2006 08:47:22 +0000 (08:47 +0000)
* src/textview.c
fix bug 1032, 'Segmentation fault when showing
message' (bug in quote folding)
Thanks to Colin

ChangeLog
PATCHSETS
configure.ac
src/textview.c

index b4cf19cd662de3adf7915044d88fd3e4d2f187df..de9380584d77c42cc11f0e90421111f721cc0ac0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-10-11 [paul]      2.5.3cvs32
+
+       * src/textview.c
+               fix bug 1032, 'Segmentation fault when showing
+               message' (bug in quote folding)
+               Thanks to Colin
+
 2006-10-10 [colin]     2.5.3cvs31
 
        * src/quote_fmt.c
index 36d0f16d254ee0a6c1a3ca487ef6b34c00267181..932e1780d2a5a0c6409afbf14c393c59b12f2ff0 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.382.2.313 -r 1.382.2.314 src/compose.c;  cvs diff -u -r 1.12.2.31 -r 1.12.2.32 src/prefs_template.c;  cvs diff -u -r 1.8.2.9 -r 1.8.2.10 src/quote_fmt.c;  cvs diff -u -r 1.5.12.5 -r 1.5.12.6 src/quote_fmt.h;  cvs diff -u -r 1.8.2.5 -r 1.8.2.6 src/quote_fmt_lex.l;  cvs diff -u -r 1.22.2.23 -r 1.22.2.24 src/quote_fmt_parse.y;  ) > 2.5.3cvs29.patchset
 ( cvs diff -u -r 1.1.2.9 -r 1.1.2.10 src/prefs_compose_writing.c;  ) > 2.5.3cvs30.patchset
 ( cvs diff -u -r 1.8.2.10 -r 1.8.2.11 src/quote_fmt.c;  ) > 2.5.3cvs31.patchset
+( cvs diff -u -r 1.96.2.154 -r 1.96.2.155 src/textview.c;  ) > 2.5.3cvs32.patchset
index bb350dd202262c6881579e242d79f936e28a51a1..a666c651268cb98e0ceed075746f432731fd401a 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=5
 MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=31
+EXTRA_VERSION=32
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 425db39bf914448b6a90d041d1a44cb86f12153c..d291c8cdca56b8fc7aff97b3e356d4e7612d6850 100644 (file)
@@ -602,7 +602,7 @@ static void textview_add_part(TextView *textview, MimeInfo *mimeinfo)
        buffer = gtk_text_view_get_buffer(text);
        charcount = gtk_text_buffer_get_char_count(buffer);
        gtk_text_buffer_get_end_iter(buffer, &iter);
-
+       
        if (textview->stop_loading) {
                return;
        }
@@ -611,6 +611,8 @@ static void textview_add_part(TextView *textview, MimeInfo *mimeinfo)
                return;
        }
 
+       previousquotelevel = -1;
+
        if ((mimeinfo->type == MIMETYPE_MESSAGE) && !g_ascii_strcasecmp(mimeinfo->subtype, "rfc822")) {
                FILE *fp;
 
@@ -1398,6 +1400,7 @@ static void textview_write_line(TextView *textview, const gchar *str,
        }
 
        if (real_quotelevel > -1 && do_quote_folding) {
+do_quote:
                if ( previousquotelevel != real_quotelevel ) {
                        ClickableText *uri;
                        uri = g_new0(ClickableText, 1);
@@ -1422,8 +1425,14 @@ static void textview_write_line(TextView *textview, const gchar *str,
                } else {
                        GSList *last = textview->uri_list;
                        ClickableText *lasturi = (ClickableText *)last->data;
-                       gint e_len = lasturi->data ? strlen(lasturi->data):0;
-                       gint n_len = strlen(buf);
+                       gint e_len = 0, n_len = 0;
+                       
+                       if (lasturi->is_quote == FALSE) {
+                               previousquotelevel = -1;
+                               goto do_quote;
+                       }
+                       e_len = lasturi->data ? strlen(lasturi->data):0;
+                       n_len = strlen(buf);
                        lasturi->data = g_realloc((gchar *)lasturi->data, e_len + n_len + 1);
                        strcpy((gchar *)lasturi->data + e_len, buf);
                        *((gchar *)lasturi->data + e_len + n_len) = '\0';