From: Timo Sirainen Date: Fri, 2 Jul 2004 13:34:37 +0000 (+0300) Subject: body_offset wasn't set if mail had no header. X-Git-Tag: 1.1.alpha1~3842 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70e3923cbcba51da95186c1ee146ed1ef204148a;p=thirdparty%2Fdovecot%2Fcore.git body_offset wasn't set if mail had no header. --HG-- branch : HEAD --- 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'; }