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

tss at dovecot.org tss at dovecot.org
Wed Apr 4 08:49:22 EEST 2007


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

Modified Files:
	message-header-parser.c 
Log Message:
cleanup / minor optimization



Index: message-header-parser.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-mail/message-header-parser.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- message-header-parser.c	15 Dec 2006 16:55:41 -0000	1.4
+++ message-header-parser.c	4 Apr 2007 05:49:20 -0000	1.5
@@ -184,27 +184,29 @@
 		/* find ':' */
 		if (colon_pos == UINT_MAX) {
 			for (i = startpos; i < parse_size; i++) {
-				if (msg[i] <= ':') {
-					if (msg[i] == ':') {
-						colon_pos = i;
-						line->full_value_offset =
-							ctx->input->v_offset +
-							i + 1;
-						break;
-					}
-					if (msg[i] == '\n') {
-						/* end of headers, or error */
-						break;
-					}
+				if (msg[i] > ':')
+					continue;
 
-					if (msg[i] == '\0')
-						ctx->has_nuls = TRUE;
+				if (msg[i] == ':') {
+					colon_pos = i;
+					line->full_value_offset =
+						ctx->input->v_offset + i + 1;
+					break;
+				}
+				if (msg[i] == '\n') {
+					/* end of headers, or error */
+					break;
 				}
+
+				if (msg[i] == '\0')
+					ctx->has_nuls = TRUE;
 			}
+		} else {
+			i = startpos;
 		}
 
 		/* find '\n' */
-		for (i = startpos; i < parse_size; i++) {
+		for (; i < parse_size; i++) {
 			if (msg[i] <= '\n') {
 				if (msg[i] == '\n')
 					break;



More information about the dovecot-cvs mailing list