]> Pileus Git - ~andy/fetchmail/commitdiff
Henrik's fix.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 12 May 1998 16:30:16 +0000 (16:30 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 12 May 1998 16:30:16 +0000 (16:30 -0000)
svn path=/trunk/; revision=1767

NEWS
driver.c
fetchmail.h
unmime.c

diff --git a/NEWS b/NEWS
index edbebbb2d0a883011ef89e93ef68b4ae5a59b267..04548fcb885d5ea10134aa6765743e4eb6eb265a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,7 @@
 fetchmail-4.4.5 ():
 * Make RPA logging use error() rather than stderr.
 * Autoconfiguration support for NetBSD.
+* Henrik Storner's fix for a minor mimedecode bug.
 
 There are 273 people on fetchmail-friends and 209 on fetchmail-announce.
 
index 546c9609042306f152a1f1cb15c7e900637ca74a..dea10ba566f2bbf6d24ccb0aa3918275f2421e84 100644 (file)
--- a/driver.c
+++ b/driver.c
@@ -995,7 +995,7 @@ int num;            /* index of message */
        UnMimeHeader(headers);
     }
     /* Check for MIME headers indicating possible 8-bit data */
-    mimemsg = MimeBodyType(headers);
+    mimemsg = MimeBodyType(headers, ctl->mimedecode);
 
     /*
      * If there is a Return-Path address on the message, this was
index 891c2ec8b874212adad5fc3d8dd476cd673f9cd6..867bbad0206aff965126bb6010f7440d5ffa6729 100644 (file)
@@ -333,7 +333,7 @@ int from64tobits(char *, const char *);
 #define MSG_IS_8BIT       0x02
 #define MSG_NEEDS_DECODE  0x80
 extern void UnMimeHeader(unsigned char *buf);
-extern int  MimeBodyType(unsigned char *hdrs);
+extern int  MimeBodyType(unsigned char *hdrs, int WantDecode);
 extern int  UnMimeBodyline(unsigned char **buf, int collapsedoubledot);
 
 /* interface.c */
index 26c41637dbad816c4ffeac80527296479dc1dd9d..0f0dcf42a81a86dbbdedc0e3759548428781645d 100644 (file)
--- a/unmime.c
+++ b/unmime.c
@@ -339,7 +339,7 @@ static char *GetBoundary(char *CntType)
  *
  * The return value is a bitmask.
  */
-int MimeBodyType(unsigned char *hdrs)
+int MimeBodyType(unsigned char *hdrs, int WantDecode)
 {
   unsigned char *NxtHdr = hdrs;
   unsigned char *XferEnc, *XferEncOfs, *CntType, *MimeVer, *p;
@@ -440,7 +440,9 @@ int MimeBodyType(unsigned char *hdrs)
       if (strcasecmp(XferEnc, "quoted-printable") == 0) {
        CurrEncodingIsQP = 1;
        BodyType = (MSG_IS_8BIT | MSG_NEEDS_DECODE);
-        SetEncoding8bit(XferEncOfs);
+       if (WantDecode) {
+           SetEncoding8bit(XferEncOfs);
+        }
       }
       else if (strcasecmp(XferEnc, "7bit") == 0) {
        CurrEncodingIsQP = 0;
@@ -643,7 +645,7 @@ int main(int argc, char *argv[])
   DBG_FWRITE(buffer, strlen(buffer), 1, fd_orig);
 
   UnMimeHeader(buffer);
-  bodytype = MimeBodyType(buffer);
+  bodytype = MimeBodyType(buffer, 1);
 
   i = strlen(buffer);
   fwrite(buffer, i, 1, stdout);