Brought over the updated mime parser from citadel
authorArt Cancro <ajc@citadel.org>
Tue, 13 Mar 2007 02:41:50 +0000 (02:41 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 13 Mar 2007 02:41:50 +0000 (02:41 +0000)
webcit/mime_parser.c

index 21dce132bf28df8c73cfb3848188c9f525cca1ea..79d3116c4cf5e05b2ae8abd5770fb12793521b67 100644 (file)
@@ -14,6 +14,7 @@
 #include "mime_parser.h"
 
 
+
 void extract_key(char *target, char *source, char *key)
 {
        int a, b;
@@ -83,6 +84,7 @@ int CtdlDecodeQuotedPrintable(char *decoded, char *encoded, int sourcelen) {
        return(decoded_length);
 }
 
+
 /*
  * Given a message or message-part body and a length, handle any necessary
  * decoding and pass the request up the stack.
@@ -438,9 +440,14 @@ void the_mime_parser(char *partnum,
                        ++length;
                }
                part_end = content_end;
-               /* fix an off-by-one error */
+
+               /******
+                * I thought there was an off-by-one error here, but there isn't.
+                * This probably means that there's an off-by-one error somewhere
+                * else ... or maybe only in certain messages?
                --part_end;
                --length;
+               ******/
                
                /* Truncate if the header told us to */
                if ( (content_length > 0) && (length > content_length) ) {
@@ -586,4 +593,5 @@ void mime_parser(char *content_start,
 }
 
 
+
 /*@}*/