summaryrefslogtreecommitdiff
path: root/components/text
diff options
context:
space:
mode:
authorJohn Sullivan <sullivan@src.gnome.org>2001-04-24 16:13:36 +0000
committerJohn Sullivan <sullivan@src.gnome.org>2001-04-24 16:13:36 +0000
commit6dbc0189310e230ff9c0df8b037cec3bc3045db5 (patch)
tree4d2caf0937f4b546bf8adbb8603893a7a7edb4fc /components/text
parente0e279c305d1bce080687de27f4183bb7138fd0e (diff)
downloadnautilus-6dbc0189310e230ff9c0df8b037cec3bc3045db5.tar.gz
reviewed by: Darin Adler <darin@eazel.com>
Fixed bug 7650 (Display flashes forever when Text viewer used in FTP) * components/text/nautilus-text-view.c: (file_read_callback): Bail out when bytes_read is 0, instead of trying again forever. This happens at EOF.
Diffstat (limited to 'components/text')
-rw-r--r--components/text/nautilus-text-view.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/components/text/nautilus-text-view.c b/components/text/nautilus-text-view.c
index dd3d48139..20c7f3333 100644
--- a/components/text/nautilus-text-view.c
+++ b/components/text/nautilus-text-view.c
@@ -304,8 +304,9 @@ file_read_callback (GnomeVFSAsyncHandle *vfs_handle,
text_view = NAUTILUS_TEXT_VIEW (callback_data);
text_view->details->file_size += bytes_read;
-
- if (result == GNOME_VFS_OK) {
+
+ /* at EOF, bytes_read is 0 and result is GNOME_VFS_OK */
+ if (result == GNOME_VFS_OK && bytes_read > 0) {
/* write the buffer into the text field */
display = GTK_TEXT (text_view->details->text_display);
if (!GTK_OBJECT_DESTROYED (display)) {