From a5173950563b0b5aef1a605db8298835f68b00c8 Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 15 Sep 2008 14:29:09 +0000 Subject: [PATCH] * encoding.c (rb_enc_get_index): don't return -1. * io.c (rb_scan_open_args): call FilePathValue before encoding conversion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ encoding.c | 1 + io.c | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 78366c4874..0eb2e48a4a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Mon Sep 15 23:28:28 2008 Tanaka Akira + + * encoding.c (rb_enc_get_index): don't return -1. + + * io.c (rb_scan_open_args): call FilePathValue before encoding + conversion. + Mon Sep 15 20:57:00 2008 Yuki Sonoda (Yugui) * lib/matrix.rb (Matrix#eql?): fixed [ruby-dev:36298]. diff --git a/encoding.c b/encoding.c index 61dc93836e..288395b1dd 100644 --- a/encoding.c +++ b/encoding.c @@ -549,6 +549,7 @@ rb_enc_get_index(VALUE obj) VALUE tmp; switch (BUILTIN_TYPE(obj)) { + default: case T_STRING: case T_REGEXP: i = ENCODING_GET_INLINED(obj); diff --git a/io.c b/io.c index 66b2afbac5..5ac75839ec 100644 --- a/io.c +++ b/io.c @@ -4631,6 +4631,7 @@ rb_scan_open_args(int argc, VALUE *argv, opt = pop_last_hash(&argc, &argv); rb_scan_args(argc, argv, "12", &fname, &vmode, &vperm); + FilePathValue(fname); #if defined _WIN32 || defined __APPLE__ { static rb_encoding *fs_encoding; @@ -4650,7 +4651,6 @@ rb_scan_open_args(int argc, VALUE *argv, } } #endif - FilePathValue(fname); rb_io_extract_modeenc(&vmode, opt, &oflags, &fmode, convconfig_p);