2004-12-09 [colin] 0.9.13cvs10
authorColin Leroy <colin@colino.net>
Thu, 9 Dec 2004 09:30:30 +0000 (09:30 +0000)
committerColin Leroy <colin@colino.net>
Thu, 9 Dec 2004 09:30:30 +0000 (09:30 +0000)
* src/procmime.c
Fix procmime_encode_content doing horribly wrong
stuff when encoding to B64 from memory

ChangeLog.claws
PATCHSETS
configure.ac
src/procmime.c

index cf053b0c8600df96eb03d834c03014f36fcd9c91..ce08f3a583eed6ec706706ac6add16ea7a904691 100644 (file)
@@ -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
 2004-12-08 [colin]     0.9.13cvs9
 
        * src/gtk/colorlabel.c
index b6b532c148871938a319c8ec042d0a14a5914bfc..01d77ac3bff41586acc7f20e7e34ef6f2fef2354 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( 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.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
index 422bf4de087fd2cf419abbf333072f227ad66bc3..4ec0b825c92a1f556d1a0af06de36c1290eb5d78 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=13
 INTERFACE_AGE=0
 BINARY_AGE=0
 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
 EXTRA_RELEASE=
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
index b035ab29a17f7e1a8d7ae97eff7a03ed5d60ac28..bb6d4627487e920290c8ccb7cab45d3b2bed626d 100644 (file)
@@ -428,16 +428,27 @@ gboolean procmime_encode_content(MimeInfo *mimeinfo, EncodingType encoding)
 
                if (mimeinfo->type == MIMETYPE_TEXT ||
                    mimeinfo->type == MIMETYPE_MESSAGE) {
 
                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);
                                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);
                        fclose(tmp_fp);
                        unlink(tmp_file);
                        g_free(tmp_file);
-               }
+               } 
        } else if (encoding == ENC_QUOTED_PRINTABLE) {
                gchar inbuf[BUFFSIZE], outbuf[BUFFSIZE * 4];
 
        } else if (encoding == ENC_QUOTED_PRINTABLE) {
                gchar inbuf[BUFFSIZE], outbuf[BUFFSIZE * 4];