diff src/lib-mail/message-parser.c @ 290:3dcc2275b4ca HEAD

IOBuffer cleanup, hopefully fixes some mbox problems.
author Timo Sirainen <tss@iki.fi>
date Mon, 23 Sep 2002 11:27:32 +0300
parents d0ba9a65891c
children f15420cb362d
line wrap: on
line diff
--- a/src/lib-mail/message-parser.c	Sun Sep 22 12:27:21 2002 +0300
+++ b/src/lib-mail/message-parser.c	Mon Sep 23 11:27:32 2002 +0300
@@ -329,12 +329,10 @@
 			continue;
 		}
 
-		if (ret < 0) {
-			/* EOF, but we may still have something in buffer.
-			   this is needed only when there's no message body */
-			msg = io_buffer_get_data(inbuf, &size);
-			if (size == startpos)
-				break;
+		if (ret < 0 || (ret == 0 && size == startpos)) {
+			/* EOF and nothing in buffer. the later check is
+			   needed only when there's no message body */
+			break;
 		}
 
 		for (i = startpos; i < size; i++) {
@@ -573,10 +571,8 @@
 
 	/* now, see if it's end boundary */
 	end_boundary = FALSE;
-	if (io_buffer_read_data_blocking(inbuf, &msg, &size, 1) > 0) {
-		i_assert(size >= 2);
+	if (io_buffer_read_data_blocking(inbuf, &msg, &size, 1) > 0)
 		end_boundary = msg[0] == '-' && msg[1] == '-';
-	}
 
 	/* skip the rest of the line */
 	message_skip_line(inbuf, boundary_size);