Commit 281d7d4e 281d7d4eb6364095a4bd64c4664c325864d7e573 by Frederic Gobry

fixed handling of last bytes

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