From ec9d4d9a12991ce69b71fd48c9f88c272073ab80 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Thu, 10 Dec 2009 22:18:46 +0000 Subject: [PATCH] * we were loosing the message Data blob in some weird edge cases. be a bit more paranoid about creating it --- webcit/msg_renderers.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/webcit/msg_renderers.c b/webcit/msg_renderers.c index 94c25dd32..c7cb3670e 100644 --- a/webcit/msg_renderers.c +++ b/webcit/msg_renderers.c @@ -468,7 +468,10 @@ void render_MAIL(wc_mime_attachment *Mime, StrBuf *RawData, StrBuf *FoundCharset { const StrBuf *TemplateMime; - Mime->Data = NewStrBufPlain(NULL, Mime->length); + if (Mime->Data == NULL) + Mime->Data = NewStrBufPlain(NULL, Mime->length); + else + FlushStrBuf(Mime->Data); read_message(Mime->Data, HKEY("view_submessage"), Mime->msgnum, Mime->PartNum, &TemplateMime); /* if ( (!IsEmptyStr(mime_submessages)) && (!section[0]) ) { @@ -532,10 +535,13 @@ void render_MIME_VNote(wc_mime_attachment *Mime, StrBuf *RawData, StrBuf *FoundC vnote_free(v); Mime->Data = Buf; } - else - Mime->Data = NewStrBuf(); + else { + if (Mime->Data == NULL) + Mime->Data = NewStrBuf(); + else + FlushStrBuf(Mime->Data); + } } - } void render_MIME_ICS(wc_mime_attachment *Mime, StrBuf *RawData, StrBuf *FoundCharset) @@ -679,7 +685,10 @@ int Conditional_MAIL_SUMM_H_NODE(StrBuf *Target, WCTemplputParams *TP) void examine_text(message_summary *Msg, StrBuf *HdrLine, StrBuf *FoundCharset) { - Msg->MsgBody->Data = NewStrBufPlain(NULL, SIZ); + if (Msg->MsgBody->Data == NULL) + Msg->MsgBody->Data = NewStrBufPlain(NULL, SIZ); + else + FlushStrBuf(Msg->MsgBody->Data); } void examine_msg4_partnum(message_summary *Msg, StrBuf *HdrLine, StrBuf *FoundCharset) -- 2.30.2