diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-01-17 07:38:32 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-01-17 07:38:32 +0800 |
commit | bd788027df6589ff8b52c87a913322ae9065c394 (patch) | |
tree | bfdd4b7614e366db24303868cf40072661e7fb55 | |
parent | 87590252919a43ad6375d9b19243bd750137dbcb (diff) | |
download | gsoc2013-evolution-bd788027df6589ff8b52c87a913322ae9065c394.tar gsoc2013-evolution-bd788027df6589ff8b52c87a913322ae9065c394.tar.gz gsoc2013-evolution-bd788027df6589ff8b52c87a913322ae9065c394.tar.bz2 gsoc2013-evolution-bd788027df6589ff8b52c87a913322ae9065c394.tar.lz gsoc2013-evolution-bd788027df6589ff8b52c87a913322ae9065c394.tar.xz gsoc2013-evolution-bd788027df6589ff8b52c87a913322ae9065c394.tar.zst gsoc2013-evolution-bd788027df6589ff8b52c87a913322ae9065c394.zip |
If we don't want to corrupt the uuencoded data by overwriting it with
2002-01-16 Jeffrey Stedfast <fejj@ximian.com>
* camel-mime-filter-basic.c (filter): If we don't want to corrupt
the uuencoded data by overwriting it with base64 decoded data
afterward, we need to add a break statement!
* camel-folder-summary.c (summary_build_content_info): Add code to
add a uu filter.
(camel_folder_summary_finalize): Unref the uuencode filter.
svn path=/trunk/; revision=15347
-rw-r--r-- | camel/ChangeLog | 10 | ||||
-rw-r--r-- | camel/camel-folder-summary.c | 9 | ||||
-rw-r--r-- | camel/camel-mime-filter-basic.c | 3 | ||||
-rw-r--r-- | camel/camel-private.h | 1 |
4 files changed, 23 insertions, 0 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 2400ab049c..011388a8b9 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,5 +1,15 @@ 2002-01-16 Jeffrey Stedfast <fejj@ximian.com> + * camel-mime-filter-basic.c (filter): If we don't want to corrupt + the uuencoded data by overwriting it with base64 decoded data + afterward, we need to add a break statement! + + * camel-folder-summary.c (summary_build_content_info): Add code to + add a uu filter. + (camel_folder_summary_finalize): Unref the uuencode filter. + +2002-01-16 Jeffrey Stedfast <fejj@ximian.com> + * camel-mime-filter-basic.c (filter): Fixed slight logic error to find the uuencode begin line. Fixes bug #18754. diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c index d2b3c9fba6..9c79ad80f3 100644 --- a/camel/camel-folder-summary.c +++ b/camel/camel-folder-summary.c @@ -207,6 +207,8 @@ camel_folder_summary_finalize (CamelObject *obj) camel_object_unref((CamelObject *)p->filter_64); if (p->filter_qp) camel_object_unref((CamelObject *)p->filter_qp); + if (p->filter_uu) + camel_object_unref((CamelObject *)p->filter_uu); if (p->filter_save) camel_object_unref((CamelObject *)p->filter_save); if (p->filter_html) @@ -1904,6 +1906,13 @@ summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, Cam else camel_mime_filter_reset((CamelMimeFilter *)p->filter_qp); enc_id = camel_mime_parser_filter_add(mp, (CamelMimeFilter *)p->filter_qp); + } else if (!strcasecmp (encoding, "x-uuencode")) { + d(printf(" decoding x-uuencode\n")); + if (p->filter_uu == NULL) + p->filter_uu = camel_mime_filter_basic_new_type(CAMEL_MIME_FILTER_BASIC_UU_DEC); + else + camel_mime_filter_reset((CamelMimeFilter *)p->filter_uu); + enc_id = camel_mime_parser_filter_add(mp, (CamelMimeFilter *)p->filter_uu); } else { d(printf(" ignoring encoding %s\n", encoding)); } diff --git a/camel/camel-mime-filter-basic.c b/camel/camel-mime-filter-basic.c index 494f7ead7f..5e2b9f5107 100644 --- a/camel/camel-mime-filter-basic.c +++ b/camel/camel-mime-filter-basic.c @@ -54,6 +54,7 @@ camel_mime_filter_basic_init (CamelMimeFilterBasic *obj) { obj->state = 0; obj->save = 0; + obj->uulen = 0; } @@ -82,6 +83,7 @@ reset(CamelMimeFilter *mf) CamelMimeFilterBasic *f = (CamelMimeFilterBasic *)mf; f->uu_begin = FALSE; + f->uulen = 0; switch(f->type) { case CAMEL_MIME_FILTER_BASIC_QP_ENC: @@ -181,6 +183,7 @@ filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, s camel_mime_filter_set_size (mf, (len + 2) * 2 + 62, FALSE); newlen = uuencode_step (in, len, mf->outbuf, f->uubuf, &f->state, &f->save, &f->uulen); g_assert (newlen <= (len + 2) * 2 + 62); + break; case CAMEL_MIME_FILTER_BASIC_BASE64_DEC: /* output can't possibly exceed the input size */ camel_mime_filter_set_size(mf, len+3, FALSE); diff --git a/camel/camel-private.h b/camel/camel-private.h index 7eb12e6ae2..78bf1467a8 100644 --- a/camel/camel-private.h +++ b/camel/camel-private.h @@ -142,6 +142,7 @@ struct _CamelFolderSummaryPrivate { struct _CamelMimeFilterIndex *filter_index; struct _CamelMimeFilterBasic *filter_64; struct _CamelMimeFilterBasic *filter_qp; + struct _CamelMimeFilterBasic *filter_uu; struct _CamelMimeFilterSave *filter_save; struct _CamelMimeFilterHTML *filter_html; |