Blame SOURCES/dovecot-2.3.8-blockcount.patch

2c808a
diff -up dovecot-2.3.8/src/lib-storage/index/index-mail-binary.c.blockcount dovecot-2.3.8/src/lib-storage/index/index-mail-binary.c
2c808a
--- dovecot-2.3.8/src/lib-storage/index/index-mail-binary.c.blockcount	2020-12-02 11:34:10.229027593 +0100
2c808a
+++ dovecot-2.3.8/src/lib-storage/index/index-mail-binary.c	2020-12-02 11:36:47.328933276 +0100
2c808a
@@ -339,13 +339,14 @@ blocks_count_lines(struct binary_ctx *ct
2c808a
 		i_stream_skip(full_input, skip);
2c808a
 		cur_block_offset += skip;
2c808a
 
2c808a
-		if (cur_block->input->eof) {
2c808a
+		if (i_stream_read_eof(cur_block->input)) {
2c808a
 			/* go to the next block */
2c808a
-			if (++block_idx == block_count) {
2c808a
+			if (block_idx+1 == block_count) {
2c808a
 				i_assert(i_stream_read_eof(full_input));
2c808a
 				ret = -1;
2c808a
 				break;
2c808a
 			}
2c808a
+			block_idx++;
2c808a
 			cur_block++;
2c808a
 			cur_block_offset = 0;
2c808a
 		}