* io.c (open_key_args): simplified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4a2cd03fbd
commit
19569c8f25
@ -1,3 +1,7 @@
|
|||||||
|
Thu Aug 21 02:03:08 2008 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* io.c (open_key_args): simplified.
|
||||||
|
|
||||||
Thu Aug 21 01:57:03 2008 Tanaka Akira <akr@fsij.org>
|
Thu Aug 21 01:57:03 2008 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* io.c (open_key_args): IO.foreach(path, rs, limit) didn't work.
|
* io.c (open_key_args): IO.foreach(path, rs, limit) didn't work.
|
||||||
|
7
io.c
7
io.c
@ -6690,13 +6690,10 @@ open_key_args(int argc, VALUE *argv, struct foreach_arg *arg)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
v = rb_hash_aref(opt, sym_mode);
|
v = rb_hash_aref(opt, sym_mode);
|
||||||
if (!NIL_P(v)) {
|
if (NIL_P(v))
|
||||||
|
v = INT2NUM(O_RDONLY);
|
||||||
arg->io = rb_io_open(RSTRING_PTR(argv[0]), v, opt);
|
arg->io = rb_io_open(RSTRING_PTR(argv[0]), v, opt);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
arg->io = rb_io_open(RSTRING_PTR(argv[0]), INT2NUM(O_RDONLY), opt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
io_s_foreach(struct foreach_arg *arg)
|
io_s_foreach(struct foreach_arg *arg)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user