2009-09-15 [colin] 3.7.2cvs33
authorColin Leroy <colin@colino.net>
Tue, 15 Sep 2009 19:13:30 +0000 (19:13 +0000)
committerColin Leroy <colin@colino.net>
Tue, 15 Sep 2009 19:13:30 +0000 (19:13 +0000)
* src/procmime.c
Complete 3.7.1cvs42: only output directly to
final file if we get NULL byes at the start.
Still fixes saving UTF16 files, but also
fixes displaying Base64 parts with decoding
errors (parts without errors get displayed)

ChangeLog
PATCHSETS
configure.ac
src/procmime.c

index 3c50b634f62d4019279cff9020aad8874bb21c6e..f7b4e48305c2817cb718c07ee891e3a9e49aa94e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-09-15 [colin]     3.7.2cvs33
+
+       * src/procmime.c
+               Complete 3.7.1cvs42: only output directly to
+               final file if we get NULL byes at the start.
+               Still fixes saving UTF16 files, but also
+               fixes displaying Base64 parts with decoding
+               errors (parts without errors get displayed)
+
 2009-09-14 [colin]     3.7.2cvs32
 
        * src/matcher.c
index fb7f8750b9a43ad1ba8f11d63f5396517f0078ee..078cc06bc6f416e01433b924adc6d88363879f23 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.25 -r 1.1.2.26 manual/plugins.xml;  cvs diff -u -r 1.1.2.7 -r 1.1.2.8 manual/es/plugins.xml;  ) > 3.7.2cvs30.patchset
 ( cvs diff -u -r 1.36.2.174 -r 1.36.2.175 src/common/utils.c;  ) > 3.7.2cvs31.patchset
 ( cvs diff -u -r 1.75.2.65 -r 1.75.2.66 src/matcher.c;  cvs diff -u -r 1.39.2.17 -r 1.39.2.18 src/matcher.h;  cvs diff -u -r 1.25.2.33 -r 1.25.2.34 src/matcher_parser_parse.y;  cvs diff -u -r 1.43.2.81 -r 1.43.2.82 src/prefs_matcher.c;  ) > 3.7.2cvs32.patchset
+( cvs diff -u -r 1.49.2.130 -r 1.49.2.131 src/procmime.c;  ) > 3.7.2cvs33.patchset
index b24b397a8808055d28be27d148f39fe553ac31b0..7d46a9690044c74f03476228c67a79cb504b9d69 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=32
+EXTRA_VERSION=33
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 8307a9fbb58585be04577928031df035a1a17a98..4be614e37c5575165775d36150afc46147058431 100644 (file)
@@ -351,6 +351,7 @@ gboolean procmime_decode_content(MimeInfo *mimeinfo)
                gboolean uncanonicalize = FALSE;
                FILE *tmpfp = outfp;
                gboolean null_bytes = FALSE;
+               gboolean starting = TRUE;
 
                if (mimeinfo->type == MIMETYPE_TEXT ||
                    mimeinfo->type == MIMETYPE_MESSAGE) {
@@ -367,10 +368,11 @@ gboolean procmime_decode_content(MimeInfo *mimeinfo)
                decoder = base64_decoder_new();
                while ((ftell(infp) < readend) && (fgets(buf, sizeof(buf), infp) != NULL)) {
                        len = base64_decoder_decode(decoder, buf, outbuf);
-                       if (uncanonicalize == TRUE && strlen(outbuf) < len) {
+                       if (uncanonicalize == TRUE && strlen(outbuf) < len && starting) {
                                uncanonicalize = FALSE;
                                null_bytes = TRUE;
                        }
+                       starting = FALSE;
                        if (len < 0 && !got_error) {
                                g_warning("Bad BASE64 content.\n");
                                if (fwrite(_("[Error decoding BASE64]\n"),