diff options
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1696,8 +1696,9 @@ rb_io_ungetc(io, c) rb_raise(rb_eIOError, "unread stream"); rb_io_check_readable(fptr); - if (ungetc(cc, fptr->f) == EOF && cc != EOF) - rb_sys_fail(fptr->path); + if (ungetc(cc, fptr->f) == EOF && cc != EOF) { + rb_raise(rb_eIOError, "ungetc failed"); + } return Qnil; } |