summaryrefslogtreecommitdiff
path: root/libnautilus-extensions
diff options
context:
space:
mode:
authorMaciej Stachowiak <mstachow@src.gnome.org>2000-09-20 17:04:34 +0000
committerMaciej Stachowiak <mstachow@src.gnome.org>2000-09-20 17:04:34 +0000
commitaeaf819c86c5bf49cb003beac9a52efcdb173fb1 (patch)
tree9b17af0082ef8512ad1cb19aa40053113c666201 /libnautilus-extensions
parentb1dcf6b9973d6dee0c2c0d3e364578c9ed148c0f (diff)
downloadnautilus-aeaf819c86c5bf49cb003beac9a52efcdb173fb1.tar.gz
Handle GNOME_VFS_ERROR_EOF correctly.
* libnautilus-extensions/bonobo-stream-vfs.c (vfs_read): Handle GNOME_VFS_ERROR_EOF correctly.
Diffstat (limited to 'libnautilus-extensions')
-rw-r--r--libnautilus-extensions/bonobo-stream-vfs.c8
1 files changed, 6 insertions, 2 deletions
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;