diff options
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -129,18 +129,14 @@ rb_get_path_check(VALUE obj, int level) if (insecure_obj_p(obj, level)) { rb_insecure_operation(); } - tmp = rb_check_string_type(obj); - if (!NIL_P(tmp)) goto exit; CONST_ID(to_path, "to_path"); - if (rb_respond_to(obj, to_path)) { - tmp = rb_funcall(obj, to_path, 0, 0); - } - else { + tmp = rb_check_funcall(obj, to_path, 0, 0); + if (tmp == Qundef) { tmp = obj; } StringValue(tmp); - exit: + tmp = file_path_convert(tmp); StringValueCStr(tmp); if (obj != tmp && insecure_obj_p(tmp, level)) { |