Commit 281d7d4e 281d7d4eb6364095a4bd64c4664c325864d7e573 by Frederic Gobry

fixed handling of last bytes

1 parent 2ee5b238
2002-11-27 Frederic Gobry <frederic.gobry@smartdata.ch>
* mailbox/filter_trans.c (trans_read): applied patch from Sergey
Poznyakoff, so that filters don't forget the last bytes of a
file. Fixed an uninitialized variable problem.
* libsieve/load.c: fixed compilation when HAVE_LIBLTDL is not
defined.
2002-11-25 Sergey Poznyakoff
* doc/texinfo/Makefile.am: Fake configure into including
......
......@@ -135,7 +135,7 @@ trans_read (filter_t filter, char *optr, size_t osize, off_t offset,
size_t *n_bytes)
{
struct _trans_stream *ts = filter->data;
size_t obytes, wbytes;
size_t obytes, wbytes = 0;
int ret = 0, i;
size_t bytes, *nbytes = &bytes;
......@@ -163,7 +163,7 @@ trans_read (filter_t filter, char *optr, size_t osize, off_t offset,
ret = stream_read (filter->stream, ts->w_buf + ts->w_whd,
MU_TRANS_BSIZE - ts->w_whd, ts->offset,
&wbytes );
if (ret != 0 || wbytes == 0)
if (ret != 0)
break;
ts->offset += wbytes;
ts->w_whd += wbytes;
......