summaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-03-10 07:05:19 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-03-10 07:05:19 +0000
commit207ffc2d0afbf4f8c46368e63a4db407fe636ece (patch)
tree9832727d5254de4909d2e1a2a5e497bb06c5d8e9 /io.c
parentdaa384e1d0a1bbade2072a4f19a005cf1b8be051 (diff)
downloadruby-207ffc2d0afbf4f8c46368e63a4db407fe636ece.tar.gz
ruby-207ffc2d0afbf4f8c46368e63a4db407fe636ece.tar.xz
ruby-207ffc2d0afbf4f8c46368e63a4db407fe636ece.zip
* struct.c (rb_struct_s_def): Struct::new executes block with
generated struct class. [ruby-talk:02606] * io.c (rb_io_ungetc): raise IOError instead of calling rb_sys_fail(). [ruby-talk:23181] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/io.c b/io.c
index 3785487a8..018c74ce8 100644
--- a/io.c
+++ b/io.c
@@ -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;
}