* 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
This commit is contained in:
parent
45fa4a4b63
commit
54f236542d
@ -1,3 +1,11 @@
|
||||
Sun Dec 9 12:18:19 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* 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]
|
||||
|
||||
Sun Dec 9 12:12:23 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* string.c (tr_find): returns true if no characters to be removed is
|
||||
|
3
file.c
3
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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user