aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/file.c b/file.c
index a8df504ae1..a9864f5703 100644
--- a/file.c
+++ b/file.c
@@ -111,11 +111,10 @@ rb_get_path(VALUE obj)
to_path = rb_intern("to_path");
}
if (rb_respond_to(obj, to_path)) {
- obj = rb_funcall(obj, to_path, 0, 0);
+ tmp = rb_funcall(obj, to_path, 0, 0);
}
- tmp = obj;
- StringValueCStr(tmp);
exit:
+ StringValueCStr(tmp);
if (obj != tmp) {
rb_check_safe_obj(tmp);
}