file.c: rb_check_funcall_default for fallback value
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c4e2e584e0
commit
31e6dfee6c
5
file.c
5
file.c
@ -179,10 +179,7 @@ rb_get_path_check_to_string(VALUE obj, int level)
|
|||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
CONST_ID(to_path, "to_path");
|
CONST_ID(to_path, "to_path");
|
||||||
tmp = rb_check_funcall(obj, to_path, 0, 0);
|
tmp = rb_check_funcall_default(obj, to_path, 0, 0, obj);
|
||||||
if (tmp == Qundef) {
|
|
||||||
tmp = obj;
|
|
||||||
}
|
|
||||||
StringValue(tmp);
|
StringValue(tmp);
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user