From 31e6dfee6c066ebfe82d5898b00924f112285331 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 1 Jun 2017 12:58:02 +0000 Subject: 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 --- file.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'file.c') diff --git a/file.c b/file.c index 49015b5ae4..2af6b75874 100644 --- a/file.c +++ b/file.c @@ -179,10 +179,7 @@ rb_get_path_check_to_string(VALUE obj, int level) return obj; } CONST_ID(to_path, "to_path"); - tmp = rb_check_funcall(obj, to_path, 0, 0); - if (tmp == Qundef) { - tmp = obj; - } + tmp = rb_check_funcall_default(obj, to_path, 0, 0, obj); StringValue(tmp); return tmp; } -- cgit v1.2.3