summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-20 14:46:03 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-20 14:46:03 +0000
commit009debfd02f5024b85b5c325f42533b40f4028e9 (patch)
tree96debc8921156294506ca37d58f1ef7b7719ca94 /io.c
parent5d51ae926b39781fa99c9462d761e2dd5649f2da (diff)
downloadruby-009debfd02f5024b85b5c325f42533b40f4028e9.tar.gz
* io.c (rb_io_s_foreach): argument count check before making
Enumerator. [ruby-dev:31525] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13119 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 e78fd6c5f6..069ba21df0 100644
--- a/io.c
+++ b/io.c
@@ -5185,8 +5185,8 @@ rb_io_s_foreach(int argc, VALUE *argv, VALUE self)
VALUE fname;
struct foreach_arg arg;
- RETURN_ENUMERATOR(self, argc, argv);
rb_scan_args(argc, argv, "12", &fname, NULL, NULL);
+ RETURN_ENUMERATOR(self, argc, argv);
FilePathValue(fname);
arg.io = rb_io_open(RSTRING_PTR(fname), "r");
if (NIL_P(arg.io)) return Qnil;