From aeaf819c86c5bf49cb003beac9a52efcdb173fb1 Mon Sep 17 00:00:00 2001 From: Maciej Stachowiak Date: Wed, 20 Sep 2000 17:04:34 +0000 Subject: Handle GNOME_VFS_ERROR_EOF correctly. * libnautilus-extensions/bonobo-stream-vfs.c (vfs_read): Handle GNOME_VFS_ERROR_EOF correctly. --- libnautilus-extensions/bonobo-stream-vfs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'libnautilus-extensions') diff --git a/libnautilus-extensions/bonobo-stream-vfs.c b/libnautilus-extensions/bonobo-stream-vfs.c index 81b4aed0b..90b1c4906 100644 --- a/libnautilus-extensions/bonobo-stream-vfs.c +++ b/libnautilus-extensions/bonobo-stream-vfs.c @@ -65,12 +65,16 @@ vfs_read (BonoboStream *stream, CORBA_long count, CORBA_sequence_set_release (*buffer, TRUE); data = CORBA_sequence_CORBA_octet_allocbuf (count); - res = gnome_vfs_read(sfs->fd, data, count, &nread); + res = gnome_vfs_read (sfs->fd, data, count, &nread); if (res == GNOME_VFS_OK) { (*buffer)->_buffer = data; (*buffer)->_length = nread; - } else { + } else if (res == GNOME_VFS_ERROR_EOF) { + /* Bonobo returns a zero length buffer for end of file */ + (*buffer)->_buffer = data; + (*buffer)->_length = 0; + } else{ CORBA_free (data); CORBA_free (*buffer); *buffer = NULL; -- cgit v1.2.1