diff options
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1083,7 +1083,7 @@ rb_io_ungetc(io, c) GetOpenFile(io, fptr); rb_io_check_readable(fptr); - if (ungetc(cc, fptr->f) == EOF) + if (ungetc(cc, fptr->f) == EOF && cc != EOF) rb_sys_fail(fptr->path); return Qnil; } |