From 70e3923cbcba51da95186c1ee146ed1ef204148a Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 2 Jul 2004 16:34:37 +0300 Subject: [PATCH] body_offset wasn't set if mail had no header. --HG-- branch : HEAD --- src/lib-storage/index/mbox/istream-raw-mbox.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib-storage/index/mbox/istream-raw-mbox.c b/src/lib-storage/index/mbox/istream-raw-mbox.c index e3236b40a3..9f39b6bb06 100644 --- a/src/lib-storage/index/mbox/istream-raw-mbox.c +++ b/src/lib-storage/index/mbox/istream-raw-mbox.c @@ -203,7 +203,9 @@ static ssize_t _read(struct _istream *stream) fromp = mbox_from; from_start_pos = 0; eoh_char = rstream->body_offset == (uoff_t)-1 ? '\n' : '\0'; for (i = stream->pos; i < pos; i++) { - if (buf[i] == eoh_char && i > 0 && buf[i-1] == '\n') { + if (buf[i] == eoh_char && + ((i > 0 && buf[i-1] == '\n') || + stream->istream.v_offset + i == rstream->hdr_offset)) { rstream->body_offset = stream->istream.v_offset + i + 1; eoh_char = '\0'; } -- 2.47.3