Mercurial > dovecot > original-hg > dovecot-1.2
diff src/lib-index/mbox/mbox-append.c @ 79:d1407cb2b39b HEAD
more fix fixes (maybe i should test these before committing :)
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 28 Aug 2002 23:32:56 +0300 |
parents | 0d8bfff71b80 |
children | 2876947b8d38 |
line wrap: on
line diff
--- a/src/lib-index/mbox/mbox-append.c Wed Aug 28 23:30:32 2002 +0300 +++ b/src/lib-index/mbox/mbox-append.c Wed Aug 28 23:32:56 2002 +0300 @@ -73,12 +73,15 @@ if (lastmsg && startpos > 0) { /* end of file, remove the last [\r]\n */ - if (msg[startpos-1] == '\n') - startpos--; - if (startpos > 0 && msg[startpos-1] == '\r') - startpos--; - else - vsize--; + msg = io_buffer_get_data(inbuf, &size); + if (size == startpos) { + if (msg[startpos-1] == '\n') + startpos--; + if (startpos > 0 && msg[startpos-1] == '\r') + startpos--; + else + vsize--; + } } io_buffer_skip(inbuf, startpos);