summaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-09 03:18:21 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-09 03:18:21 +0000
commitd5a72f00c24baf10442ed6119b62bc9fa7d1fac5 (patch)
treeaad7542d6e9045277c145d7a7b2cd01a03256c88 /io.c
parent23d8ace77f84aac13185413835377cfe3fc61b94 (diff)
downloadruby-d5a72f00c24baf10442ed6119b62bc9fa7d1fac5.tar.gz
ruby-d5a72f00c24baf10442ed6119b62bc9fa7d1fac5.tar.xz
ruby-d5a72f00c24baf10442ed6119b62bc9fa7d1fac5.zip
* file.c (rb_get_path): use the original object if to_path method is
not defined. [ruby-dev:32473] * io.c (rb_f_open): call to_open on non-string objects, instead of to_str. [ruby-dev:32473] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/io.c b/io.c
index 12d4e01c5..8a0a7de2a 100644
--- a/io.c
+++ b/io.c
@@ -3799,7 +3799,8 @@ rb_f_open(int argc, VALUE *argv)
redirect = Qtrue;
}
else {
- VALUE tmp = rb_check_string_type(argv[0]);
+ VALUE tmp = argv[0];
+ FilePathValue(tmp);
if (NIL_P(tmp)) {
redirect = Qtrue;
}