summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io.c b/io.c
index e9a4ced2c0..5024b75d26 100644
--- a/io.c
+++ b/io.c
@@ -836,7 +836,7 @@ io_read(argc, argv, io)
if (n == 0) {
rb_str_resize(str,0);
if (feof(fptr->f)) return Qnil;
- rb_sys_fail(fptr->path);
+ if (len > 0) rb_sys_fail(fptr->path);
}
RSTRING(str)->len = n;
RSTRING(str)->ptr[n] = '\0';