[evolution/gnome-2-32] Bug #640829 - Can drop text/plain message lines in message preview (cherry picked from commit 065755



commit c645e03a3c1ceecc15e87474ef171fee91303487
Author: Milan Crha <mcrha redhat com>
Date:   Mon Feb 21 13:19:36 2011 +0100

    Bug #640829 - Can drop text/plain message lines in message preview
    (cherry picked from commit 065755c13c934634aeee08477ae4ed6a7d4a816e)

 mail/em-inline-filter.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/mail/em-inline-filter.c b/mail/em-inline-filter.c
index ea08595..10889bf 100644
--- a/mail/em-inline-filter.c
+++ b/mail/em-inline-filter.c
@@ -154,6 +154,7 @@ inline_filter_scan(CamelMimeFilter *f, gchar *in, gsize len, gint final)
 
 	while (inptr < inend) {
 		gint rest_len;
+		gboolean set_null_byte = FALSE;
 
 		start = inptr;
 
@@ -169,10 +170,12 @@ inline_filter_scan(CamelMimeFilter *f, gchar *in, gsize len, gint final)
 		}
 
 		rest_len = inend - start;
-		if (inptr < inend)
+		if (inptr < inend) {
 			*inptr++ = 0;
+			set_null_byte = TRUE;
+		}
 
-		#define restore_inptr() G_STMT_START { if (inptr < inend) inptr[-1] = '\n'; } G_STMT_END
+		#define restore_inptr() G_STMT_START { if (set_null_byte) inptr[-1] = '\n'; } G_STMT_END
 
 		switch (emif->state) {
 		case EMIF_PLAIN:



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