[evolution-data-server] Bug #640829 - Can drop text/plain message lines in message preview
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Bug #640829 - Can drop text/plain message lines in message preview
- Date: Mon, 21 Feb 2011 12:19:25 +0000 (UTC)
commit b0dfd4aeb2b44d56f701efca1508d2c8c6911724
Author: Milan Crha <mcrha redhat com>
Date: Mon Feb 21 13:16:42 2011 +0100
Bug #640829 - Can drop text/plain message lines in message preview
camel/camel-mime-filter.c | 31 ++++++++++++++++---------------
1 files changed, 16 insertions(+), 15 deletions(-)
---
diff --git a/camel/camel-mime-filter.c b/camel/camel-mime-filter.c
index a5e02e7..5b0f0aa 100644
--- a/camel/camel-mime-filter.c
+++ b/camel/camel-mime-filter.c
@@ -139,8 +139,6 @@ static void filter_run (CamelMimeFilter *f,
const gchar *in, gsize len, gsize prespace,
gchar **out, gsize *outlen, gsize *outprespace))
{
- struct _CamelMimeFilterPrivate *p;
-
#ifdef MALLOC_CHECK
checkmem (f->outreal);
checkmem (f->backbuf);
@@ -149,35 +147,38 @@ static void filter_run (CamelMimeFilter *f,
here we take a performance hit, if the input buffer doesn't
have the pre-space required. We make a buffer that does ...
*/
- if (prespace < f->backlen) {
- gint newlen = len+prespace+f->backlen;
+ if (f->backlen > 0) {
+ struct _CamelMimeFilterPrivate *p;
+ gint newlen;
+
p = CAMEL_MIME_FILTER_GET_PRIVATE (f);
+
+ newlen = len + prespace + f->backlen;
if (p->inlen < newlen) {
/* NOTE: g_realloc copies data, we dont need that (slower) */
g_free (p->inbuf);
p->inbuf = g_malloc (newlen+PRE_HEAD);
p->inlen = newlen+PRE_HEAD;
}
+
/* copy to end of structure */
- memcpy (p->inbuf+p->inlen - len, in, len);
- in = p->inbuf+p->inlen - len;
+ memcpy (p->inbuf + p->inlen - len, in, len);
+ in = p->inbuf + p->inlen - len;
prespace = p->inlen - len;
- }
-#ifdef MALLOC_CHECK
- checkmem (f->outreal);
- checkmem (f->backbuf);
-#endif
-
- /* preload any backed up data */
- if (f->backlen > 0) {
- memcpy ((gchar *) in-f->backlen, f->backbuf, f->backlen);
+ /* preload any backed up data */
+ memcpy ((gchar *) in - f->backlen, f->backbuf, f->backlen);
in -= f->backlen;
len += f->backlen;
prespace -= f->backlen;
f->backlen = 0;
}
+#ifdef MALLOC_CHECK
+ checkmem (f->outreal);
+ checkmem (f->backbuf);
+#endif
+
filterfunc (f, in, len, prespace, out, outlen, outprespace);
#ifdef MALLOC_CHECK
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]