From: Colin Leroy Date: Thu, 9 Dec 2004 09:30:30 +0000 (+0000) Subject: 2004-12-09 [colin] 0.9.13cvs10 X-Git-Tag: rel_1_0_0~39 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=001563c97d4dd4d5d076cb3919590e76f56602fb 2004-12-09 [colin] 0.9.13cvs10 * src/procmime.c Fix procmime_encode_content doing horribly wrong stuff when encoding to B64 from memory --- diff --git a/ChangeLog.claws b/ChangeLog.claws index cf053b0c8..ce08f3a58 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,9 @@ +2004-12-09 [colin] 0.9.13cvs10 + + * src/procmime.c + Fix procmime_encode_content doing horribly wrong + stuff when encoding to B64 from memory + 2004-12-08 [colin] 0.9.13cvs9 * src/gtk/colorlabel.c diff --git a/PATCHSETS b/PATCHSETS index b6b532c14..01d77ac3b 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -179,3 +179,4 @@ ( cvs diff -u -r 1.36 -r 1.37 src/matcher_parser_parse.y; cvs diff -u -r 1.28 -r 1.29 src/msgcache.c; cvs diff -u -r 1.48 -r 1.49 src/prefs_matcher.c; cvs diff -u -r 1.60 -r 1.61 src/procheader.c; cvs diff -u -r 1.88 -r 1.89 src/matcher.c; cvs diff -u -r 1.17 -r 1.18 src/common/defs.h; ) > 0.9.13cvs7.patchset ( cvs diff -u -r 1.26 -r 1.27 src/quote_fmt_parse.y ) > 0.9.13cvs8.patchset ( cvs diff -u -r 1.4 -r 1.5 src/gtk/colorlabel.c; ) > 0.9.13cvs9.patchset +( cvs diff -u -r 1.100 -r 1.101 src/procmime.c; ) > 0.9.13cvs10.patchset diff --git a/configure.ac b/configure.ac index 422bf4de0..4ec0b825c 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=9 MICRO_VERSION=13 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=9 +EXTRA_VERSION=10 EXTRA_RELEASE= if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then diff --git a/src/procmime.c b/src/procmime.c index b035ab29a..bb6d46274 100644 --- a/src/procmime.c +++ b/src/procmime.c @@ -428,16 +428,27 @@ gboolean procmime_encode_content(MimeInfo *mimeinfo, EncodingType encoding) if (mimeinfo->type == MIMETYPE_TEXT || mimeinfo->type == MIMETYPE_MESSAGE) { - tmp_file = get_tmp_file(); - if (canonicalize_file(mimeinfo->data.filename, tmp_file) < 0) { - g_free(tmp_file); - fclose(infp); - } - if ((tmp_fp = fopen(tmp_file, "rb")) == NULL) { - FILE_OP_ERROR(tmp_file, "fopen"); - unlink(tmp_file); - g_free(tmp_file); + if (mimeinfo->content == MIMECONTENT_FILE) { + tmp_file = get_tmp_file(); + if (canonicalize_file(mimeinfo->data.filename, tmp_file) < 0) { + g_free(tmp_file); + fclose(infp); + return FALSE; + } + if ((tmp_fp = fopen(tmp_file, "rb")) == NULL) { + FILE_OP_ERROR(tmp_file, "fopen"); + unlink(tmp_file); + g_free(tmp_file); + fclose(infp); + return FALSE; + } + } else { + gchar *out = canonicalize_str(mimeinfo->data.mem); fclose(infp); + tmp_fp = infp = str_open_as_stream(out); + g_free(out); + if (infp == NULL) + return FALSE; } } @@ -458,7 +469,7 @@ gboolean procmime_encode_content(MimeInfo *mimeinfo, EncodingType encoding) fclose(tmp_fp); unlink(tmp_file); g_free(tmp_file); - } + } } else if (encoding == ENC_QUOTED_PRINTABLE) { gchar inbuf[BUFFSIZE], outbuf[BUFFSIZE * 4];