diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | encoding.c | 1 | ||||
-rw-r--r-- | io.c | 2 |
3 files changed, 9 insertions, 1 deletions
@@ -1,3 +1,10 @@ +Mon Sep 15 23:28:28 2008 Tanaka Akira <akr@fsij.org> + + * 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) <yugui@yugui.jp> * 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); @@ -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); |