summaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-02-19 04:19:06 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-02-19 04:19:06 +0000
commit7a1b9234b1b14f314dab37c5d1a5796069663979 (patch)
tree1c4a93d44ef474f7b972682b45ad719f1517e999 /io.c
parentdfb8c0b5668b080d8410a587c093d81b69e828d3 (diff)
downloadruby-7a1b9234b1b14f314dab37c5d1a5796069663979.tar.gz
ruby-7a1b9234b1b14f314dab37c5d1a5796069663979.tar.xz
ruby-7a1b9234b1b14f314dab37c5d1a5796069663979.zip
* io.c (rb_io_ungetc): don't fail pushed EOF back.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 9f1550812..2404b1faf 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;
}