From 6c397fa70c89c4e3dbcab5b30901a64dbc5b89a2 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 16 Jul 2003 02:32:30 +0000 Subject: If we read 0 bytes, then set eos to TRUE. 2003-07-15 Jeffrey Stedfast * camel-stream-fs.c (stream_read): If we read 0 bytes, then set eos to TRUE. svn path=/trunk/; revision=21820 --- camel/ChangeLog | 9 +++++++-- camel/camel-stream-fs.c | 6 +++++- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'camel') diff --git a/camel/ChangeLog b/camel/ChangeLog index 5a4e8953cb..f766ba1b49 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,7 +1,12 @@ +2003-07-15 Jeffrey Stedfast + + * camel-stream-fs.c (stream_read): If we read 0 bytes, then set + eos to TRUE. + 2003-07-09 Jeffrey Stedfast - Get rid of the #ifdef ENABLE_THREADS since - we no longer plan to support/maintain this. + Get rid of the #ifdef ENABLE_THREADS since we no longer plan to + support/maintain this. * providers/nntp/camel-nntp-store.c: Here. diff --git a/camel/camel-stream-fs.c b/camel/camel-stream-fs.c index 501f704b6d..9f67cd9e40 100644 --- a/camel/camel-stream-fs.c +++ b/camel/camel-stream-fs.c @@ -215,11 +215,15 @@ stream_read (CamelStream *stream, char *buffer, size_t n) { CamelStreamFs *stream_fs = CAMEL_STREAM_FS (stream); CamelSeekableStream *seekable = CAMEL_SEEKABLE_STREAM (stream); + ssize_t nread; if (seekable->bound_end != CAMEL_STREAM_UNBOUND) n = MIN (seekable->bound_end - seekable->position, n); - return camel_read (stream_fs->fd, buffer, n); + if ((nread = camel_read (stream_fs->fd, buffer, n)) == 0) + stream->eos = TRUE; + + return nread; } static ssize_t -- cgit v1.2.3