diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2003-07-18 03:17:42 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2003-07-18 03:17:42 +0800 |
commit | 76c23a45f1737a6fc6d11b235ef753a082fe16cb (patch) | |
tree | 1bbbe0e39d55cc40204a92a6449fcb074ec3ec65 | |
parent | 7b6185cbe135d388e8bc872ab2a40fc67e1122f6 (diff) | |
download | gsoc2013-evolution-76c23a45f1737a6fc6d11b235ef753a082fe16cb.tar.gz gsoc2013-evolution-76c23a45f1737a6fc6d11b235ef753a082fe16cb.tar.zst gsoc2013-evolution-76c23a45f1737a6fc6d11b235ef753a082fe16cb.zip |
Increment the seekable stream position by the number of bytes read. Oops.
2003-07-17 Jeffrey Stedfast <fejj@ximian.com>
* camel-stream-fs.c (stream_read): Increment the seekable stream
position by the number of bytes read. Oops.
(stream_write): Same here.
svn path=/trunk/; revision=21862
-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 |