]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
body_offset wasn't set if mail had no header.
authorTimo Sirainen <tss@iki.fi>
Fri, 2 Jul 2004 13:34:37 +0000 (16:34 +0300)
committerTimo Sirainen <tss@iki.fi>
Fri, 2 Jul 2004 13:34:37 +0000 (16:34 +0300)
--HG--
branch : HEAD

src/lib-storage/index/mbox/istream-raw-mbox.c

index e3236b40a3c6751644910950ccf9d938932eaf5d..9f39b6bb064028b2cc0f7331dcb2623ca715d8e6 100644 (file)
@@ -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';
                }