diff options
-rw-r--r-- | camel/ChangeLog | 1 | ||||
-rw-r--r-- | camel/camel-stream-fs.c | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index cc0e60e9ed..bb654f24bc 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -2,6 +2,7 @@ * camel-stream-fs.c (stream_read): Increment the seekable stream position by the number of bytes read. Oops. + (stream_write): Same here. 2003-07-17 Timo Sirainen <tss@iki.fi> diff --git a/camel/camel-stream-fs.c b/camel/camel-stream-fs.c index b86f146e59..6560512d0c 100644 --- a/camel/camel-stream-fs.c +++ b/camel/camel-stream-fs.c @@ -233,11 +233,15 @@ stream_write (CamelStream *stream, const char *buffer, size_t n) { CamelStreamFs *stream_fs = CAMEL_STREAM_FS (stream); CamelSeekableStream *seekable = CAMEL_SEEKABLE_STREAM (stream); + ssize_t nwritten; if (seekable->bound_end != CAMEL_STREAM_UNBOUND) n = MIN (seekable->bound_end - seekable->position, n); - return camel_write (stream_fs->fd, buffer, n); + if ((nwritten = camel_write (stream_fs->fd, buffer, n)) > 0) + seekable->position += nwritten; + + return nwritten; } static int |