summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--encoding.c1
-rw-r--r--io.c2
3 files changed, 9 insertions, 1 deletions
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 <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);
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);