From d2aaaeb274bc8d95dcbbb88c9c2af604e4c51b6b Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Mon, 29 Mar 2004 17:37:55 +0000 Subject: close pre tag in case we just flush. I am not sure if it's still worth to 2004-03-29 Radek Doulik * camel-mime-filter-tohtml.c (html_convert): close pre tag in case we just flush. I am not sure if it's still worth to check for inlen == 0 and handle it specially, but didn't want to make too big changes. Fixes #55817 svn path=/trunk/; revision=25229 --- camel/ChangeLog | 9 +++++++++ camel/camel-mime-filter-tohtml.c | 18 +++++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/camel/ChangeLog b/camel/ChangeLog index d8eeab1a19..1878664afa 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,12 @@ +2004-03-29 Radek Doulik + + * camel-mime-filter-tohtml.c (html_convert): close pre tag in case + we just flush. I am not sure if it's still worth to check for + inlen == 0 and handle it specially, but didn't want to make too + big changes. + + Fixes #55817 + 2004-03-29 Not Zed * providers/imap/camel-imap-store.c (get_folder_counts): use diff --git a/camel/camel-mime-filter-tohtml.c b/camel/camel-mime-filter-tohtml.c index 678d8005f4..9d505e2514 100644 --- a/camel/camel-mime-filter-tohtml.c +++ b/camel/camel-mime-filter-tohtml.c @@ -230,9 +230,21 @@ html_convert (CamelMimeFilter *filter, char *in, size_t inlen, size_t prespace, int depth; if (inlen == 0) { - *out = in; - *outlen = 0; - *outprespace = 0; + if (html->pre_open) { + /* close the pre-tag */ + outend = filter->outbuf + filter->outsize; + outptr = check_size (filter, filter->outbuf, &outend, 10); + outptr = g_stpcpy (outptr, ""); + html->pre_open = FALSE; + + *out = filter->outbuf; + *outlen = outptr - filter->outbuf; + *outprespace = filter->outpre; + } else { + *out = in; + *outlen = 0; + *outprespace = 0; + } return; } -- cgit