summaryrefslogtreecommitdiff
path: root/file.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
commit54f236542d7a1cb28e7902a987ca583b5eefe874 (patch)
treeaad7542d6e9045277c145d7a7b2cd01a03256c88 /file.c
parent45fa4a4b634515ff9c7f1e8008990f0e7e8c46dc (diff)
* 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
Diffstat (limited to 'file.c')
-rw-r--r--file.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/file.c b/file.c
index 09be42415a..ac7ee25a57 100644
--- a/file.c
+++ b/file.c
@@ -111,6 +111,9 @@ rb_get_path(VALUE obj)
if (rb_respond_to(obj, to_path)) {
tmp = rb_funcall(obj, to_path, 0, 0);
}
+ else {
+ tmp = obj;
+ }
exit:
StringValueCStr(tmp);
if (obj != tmp) {