# HG changeset patch # User Timo Sirainen # Date 1030571190 -10800 # Node ID 18f0d0952a7daa3c4afeaba9ca36b9637d48220e # Parent 73e79cf8f4968593370769a3ee6b4b1027fc4103 fix diff -r 73e79cf8f496 -r 18f0d0952a7d src/lib-index/mbox/mbox-index.c --- a/src/lib-index/mbox/mbox-index.c Thu Aug 29 00:42:24 2002 +0300 +++ b/src/lib-index/mbox/mbox-index.c Thu Aug 29 00:46:30 2002 +0300 @@ -113,10 +113,11 @@ int mbox_skip_crlf(IOBuffer *inbuf) { unsigned char *data; - unsigned int size; + unsigned int size, pos; - while (io_buffer_read_data(inbuf, &data, &size, 1) >= 0) { - if (size > 0) { + pos = 0; + while (io_buffer_read_data(inbuf, &data, &size, pos) >= 0) { + if (size > 0 && pos == 0) { if (data[0] == '\n') { io_buffer_skip(inbuf, 1); return TRUE; @@ -124,13 +125,14 @@ if (data[0] != '\r') return FALSE; - if (size > 1) { - if (data[1] != '\n') - return FALSE; + pos++; + } + if (size > 1 && pos == 1) { + if (data[1] != '\n') + return FALSE; - io_buffer_skip(inbuf, 2); - return TRUE; - } + io_buffer_skip(inbuf, 2); + return TRUE; } }