Blame SOURCES/evolution-data-server-3.28.5-mangled-deeper-html-quotes.patch

550ffc
From 6022b2b7816fea84919eef5993363f636bf734dc Mon Sep 17 00:00:00 2001
550ffc
From: Milan Crha <mcrha@redhat.com>
550ffc
Date: Mon, 3 Sep 2018 09:43:50 +0200
550ffc
Subject: evo-I#86 - Quoting of plain text mail into HTML mode mangles deeper
550ffc
 levels
550ffc
550ffc
Related to https://gitlab.gnome.org/GNOME/evolution/issues/86
550ffc
550ffc
diff --git a/src/camel/camel-mime-filter-tohtml.c b/src/camel/camel-mime-filter-tohtml.c
550ffc
index 07024aa1a..df6283655 100644
550ffc
--- a/src/camel/camel-mime-filter-tohtml.c
550ffc
+++ b/src/camel/camel-mime-filter-tohtml.c
550ffc
@@ -303,6 +303,7 @@ html_convert (CamelMimeFilter *mime_filter,
550ffc
 	outend = mime_filter->outbuf + mime_filter->outsize;
550ffc
 
550ffc
 	if (priv->flags & CAMEL_MIME_FILTER_TOHTML_PRE && !priv->pre_open) {
550ffc
+		outptr = check_size (mime_filter, outptr, &outend, 6);
550ffc
 		outptr = g_stpcpy (outptr, "
");
550ffc
 		priv->pre_open = TRUE;
550ffc
 	}
550ffc
@@ -339,13 +340,13 @@ html_convert (CamelMimeFilter *mime_filter,
550ffc
 
550ffc
 			depth = citation_depth (start, inend, &skip);
550ffc
 			while (priv->blockquote_depth < depth) {
550ffc
-				outptr = check_size (mime_filter, outptr, &outend, 30);
550ffc
-				outptr = g_stpcpy (outptr, "
\n");
550ffc
+				outptr = check_size (mime_filter, outptr, &outend, 25);
550ffc
+				outptr = g_stpcpy (outptr, "
");
550ffc
 				priv->blockquote_depth++;
550ffc
 			}
550ffc
 			while (priv->blockquote_depth > depth) {
550ffc
-				outptr = check_size (mime_filter, outptr, &outend, 15);
550ffc
-				outptr = g_stpcpy (outptr, "\n");
550ffc
+				outptr = check_size (mime_filter, outptr, &outend, 14);
550ffc
+				outptr = g_stpcpy (outptr, "");
550ffc
 				priv->blockquote_depth--;
550ffc
 			}
550ffc
 #if FOOLISHLY_UNMUNGE_FROM
550ffc
@@ -463,14 +464,14 @@ html_convert (CamelMimeFilter *mime_filter,
550ffc
 				outptr, &outend);
550ffc
 
550ffc
 		while (priv->blockquote_depth > 0) {
550ffc
-			outptr = check_size (mime_filter, outptr, &outend, 15);
550ffc
+			outptr = check_size (mime_filter, outptr, &outend, 14);
550ffc
 			outptr = g_stpcpy (outptr, "");
550ffc
 			priv->blockquote_depth--;
550ffc
 		}
550ffc
 
550ffc
 		if (priv->pre_open) {
550ffc
 			/* close the pre-tag */
550ffc
-			outptr = check_size (mime_filter, outptr, &outend, 10);
550ffc
+			outptr = check_size (mime_filter, outptr, &outend, 7);
550ffc
 			outptr = g_stpcpy (outptr, "");
550ffc
 			priv->pre_open = FALSE;
550ffc
 		}