[dovecot-cvs] dovecot/src/lib-mail message-header-parser.c, 1.5, 1.6

tss at dovecot.org tss at dovecot.org
Wed Apr 4 11:57:58 EEST 2007


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

Modified Files:
	message-header-parser.c 
Log Message:
We didn't add CRs to full_value if original input had them.



Index: message-header-parser.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-mail/message-header-parser.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- message-header-parser.c	4 Apr 2007 05:49:20 -0000	1.5
+++ message-header-parser.c	4 Apr 2007 08:57:55 -0000	1.6
@@ -59,7 +59,7 @@
 	const unsigned char *msg;
 	size_t i, size, startpos, colon_pos, parse_size;
 	int ret;
-	bool last_no_newline;
+	bool last_no_newline, last_crlf;
 
 	*hdr_r = NULL;
 	if (line->eoh)
@@ -72,6 +72,7 @@
 
 	startpos = 0; colon_pos = UINT_MAX;
 
+	last_crlf = line->crlf_newline;
 	last_no_newline = line->no_newline;
 	line->no_newline = FALSE;
 	line->crlf_newline = FALSE;
@@ -335,8 +336,11 @@
 		line->full_value_len = line->value_len;
 	} else if (line->use_full_value) {
 		/* continue saving the full value */
-		if (!last_no_newline)
+		if (!last_no_newline) {
+			if (last_crlf)
+				buffer_append_c(ctx->value_buf, '\r');
 			buffer_append_c(ctx->value_buf, '\n');
+		}
 		buffer_append(ctx->value_buf, line->value, line->value_len);
 		line->full_value = buffer_get_data(ctx->value_buf,
 						   &line->full_value_len);



More information about the dovecot-cvs mailing list