aboutsummaryrefslogtreecommitdiffstats
path: root/transact.c
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2009-05-04 19:01:17 +0000
committerMatthias Andree <matthias.andree@gmx.de>2009-05-04 19:01:17 +0000
commit27237c0c0ad54af1bdb23aa0103f5c6c4bce570b (patch)
tree415acbb54e1bb1207241993b096c0b2be1dacedf /transact.c
parent2d5717089b8c2be49f449388c2f045de8c52a245 (diff)
downloadfetchmail-27237c0c0ad54af1bdb23aa0103f5c6c4bce570b.tar.gz
fetchmail-27237c0c0ad54af1bdb23aa0103f5c6c4bce570b.tar.bz2
fetchmail-27237c0c0ad54af1bdb23aa0103f5c6c4bce570b.zip
Fix formatting around MIME decoding.
svn path=/branches/BRANCH_6-3/; revision=5279
Diffstat (limited to 'transact.c')
-rw-r--r--transact.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/transact.c b/transact.c
index efb65f3c..86719766 100644
--- a/transact.c
+++ b/transact.c
@@ -3,8 +3,6 @@
*
* Copyright 2001 by Eric S. Raymond
* For license terms, see the file COPYING in this directory.
- *
- *
*/
#include "config.h"
@@ -614,22 +612,23 @@ int readheaders(int sock,
{
print_ticker(&sizeticker, linelen);
}
+
+ /*
+ * Decode MIME encoded headers. We MUST do this before
+ * looking at the Content-Type / Content-Transfer-Encoding
+ * headers (RFC 2046).
+ */
+ if ( ctl->mimedecode )
+ {
+ char *tcp;
+ UnMimeHeader(line);
+ /* the line is now shorter. So we retrace back till we find
+ * our terminating combination \n\0, we move backwards to
+ * make sure that we don't catch some \n\0 stored in the
+ * decoded part of the message */
+ for (tcp = line + linelen - 1; tcp > line && (*tcp != 0 || tcp[-1] != '\n'); tcp--);
+ if (tcp > line) linelen = tcp - line;
}
- /*
- * Decode MIME encoded headers. We MUST do this before
- * looking at the Content-Type / Content-Transfer-Encoding
- * headers (RFC 2046).
- */
- if ( ctl->mimedecode )
- {
- char *tcp;
- UnMimeHeader(line);
- /* the line is now shorter. So we retrace back till we find our terminating
- * combination \n\0, we move backwards to make sure that we don't catch som
- * \n\0 stored in the decoded part of the message */
- for(tcp = line + linelen - 1; tcp > line && (*tcp != 0 || tcp[-1] != '\n'); tcp--);
- if(tcp > line) linelen = tcp - line;
- }
/* skip processing if we are going to retain or refuse this mail */