From 0cbfe8c52474ebf6911a6c1e3f0b8c82885cc07f Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 19 Feb 2002 04:19:06 +0000 Subject: * io.c (rb_io_ungetc): don't fail pushed EOF back. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'io.c') diff --git a/io.c b/io.c index 9f1550812a..2404b1faf5 100644 --- a/io.c +++ b/io.c @@ -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; } -- cgit v1.2.3