[dovecot-cvs] dovecot/src/lib-index/mbox istream-mbox.c,1.6,1.7
cras at procontrol.fi
cras at procontrol.fi
Wed Oct 29 17:31:47 EET 2003
Update of /home/cvs/dovecot/src/lib-index/mbox
In directory danu:/tmp/cvs-serv17132/lib-index/mbox
Modified Files:
istream-mbox.c
Log Message:
fixes
Index: istream-mbox.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/mbox/istream-mbox.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- istream-mbox.c 29 Oct 2003 15:01:36 -0000 1.6
+++ istream-mbox.c 29 Oct 2003 15:31:45 -0000 1.7
@@ -75,15 +75,13 @@
ret = i_stream_read(mstream->input);
+ mstream->istream.pos -= mstream->istream.skip;
mstream->istream.skip = 0;
mstream->istream.buffer = i_stream_get_data(mstream->input, &pos);
- if (pos <= mstream->istream.pos)
- ret = -1;
- else {
- ret = pos - mstream->istream.pos;
- mstream->istream.pos = pos;
- }
+ ret = pos <= mstream->istream.pos ? -1 :
+ (ssize_t) (pos - mstream->istream.pos);
+ mstream->istream.pos = pos;
if (limit != old_limit)
i_stream_set_read_limit(mstream->input, old_limit);
@@ -106,8 +104,8 @@
stream->skip = stream->pos = stream->high_pos = 0;
stream->buffer = NULL;
- v_offset += mstream->header_size.physical_size -
- mstream->header_size.virtual_size;
+ v_offset += (off_t)mstream->header_size.physical_size -
+ (off_t)mstream->header_size.virtual_size;
i_stream_seek(mstream->input, v_offset);
}
}
More information about the dovecot-cvs
mailing list