* io.c (rb_open_file): don't access argv[-1] by
File.allocate.instance_eval { initialize }. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
93ad576b05
commit
d889297933
@ -1,3 +1,8 @@
|
|||||||
|
Tue Aug 19 01:02:19 2008 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* io.c (rb_open_file): don't access argv[-1] by
|
||||||
|
File.allocate.instance_eval { initialize }.
|
||||||
|
|
||||||
Tue Aug 19 00:56:01 2008 Tanaka Akira <akr@fsij.org>
|
Tue Aug 19 00:56:01 2008 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* re.c (rb_reg_inspect): don't raise for uninitialized Regexp.
|
* re.c (rb_reg_inspect): don't raise for uninitialized Regexp.
|
||||||
|
18
io.c
18
io.c
@ -4461,14 +4461,16 @@ rb_open_file(int argc, VALUE *argv, VALUE io)
|
|||||||
int flags;
|
int flags;
|
||||||
unsigned int fmode;
|
unsigned int fmode;
|
||||||
|
|
||||||
opt = rb_check_convert_type(argv[argc-1], T_HASH, "Hash", "to_hash");
|
if (0 < argc) {
|
||||||
if (!NIL_P(opt)) {
|
opt = rb_check_convert_type(argv[argc-1], T_HASH, "Hash", "to_hash");
|
||||||
VALUE v;
|
if (!NIL_P(opt)) {
|
||||||
v = rb_hash_aref(opt, sym_mode);
|
VALUE v;
|
||||||
if (!NIL_P(v)) vmode = v;
|
v = rb_hash_aref(opt, sym_mode);
|
||||||
v = rb_hash_aref(opt, sym_perm);
|
if (!NIL_P(v)) vmode = v;
|
||||||
if (!NIL_P(v)) perm = v;
|
v = rb_hash_aref(opt, sym_perm);
|
||||||
argc -= 1;
|
if (!NIL_P(v)) perm = v;
|
||||||
|
argc -= 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rb_scan_args(argc, argv, "12", &fname, &vmode, &perm);
|
rb_scan_args(argc, argv, "12", &fname, &vmode, &perm);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user