From 54f236542d7a1cb28e7902a987ca583b5eefe874 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 9 Dec 2007 03:18:21 +0000 Subject: * 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@14152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'io.c') diff --git a/io.c b/io.c index 12d4e01c59..8a0a7de2a2 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; } -- cgit v1.2.3