[dovecot-cvs] dovecot/src/lib-mail message-parser.c,1.76,1.77

tss at dovecot.org tss at dovecot.org
Sun Jan 14 02:48:17 UTC 2007


Update of /var/lib/cvs/dovecot/src/lib-mail
In directory talvi:/tmp/cvs-serv17065

Modified Files:
	message-parser.c 
Log Message:
CR removing from parsed mails didn't work properly for multipart mails.



Index: message-parser.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-mail/message-parser.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -r1.76 -r1.77
--- message-parser.c	15 Dec 2006 16:55:42 -0000	1.76
+++ message-parser.c	14 Jan 2007 02:48:15 -0000	1.77
@@ -652,8 +652,7 @@
 			      off_t diff)
 {
 	while (parts != NULL) {
-		uoff_t old_size = parts->header_size.physical_size +
-			parts->body_size.physical_size;
+		parts->physical_pos += diff;
 
 		if (use_crlf) {
 			parts->header_size.physical_size =
@@ -667,18 +666,18 @@
 			parts->body_size.physical_size =
 				parts->body_size.virtual_size -
 				parts->body_size.lines;
-		}
-		parts->physical_pos += diff;
 
-		diff += (off_t)(parts->header_size.physical_size +
-				parts->body_size.physical_size) -
-			(off_t)old_size;
+			diff -= parts->header_size.lines;
+		}
 
 		if (parts->children != NULL) {
 			message_parser_set_crlfs_diff(parts->children,
 						      use_crlf, diff);
 		}
 
+		if (!use_crlf)
+			diff -= parts->body_size.lines;
+
 		parts = parts->next;
 	}
 }



More information about the dovecot-cvs mailing list