summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/dir.c b/dir.c
index dd28537217..617dad7796 100644
--- a/dir.c
+++ b/dir.c
@@ -280,8 +280,7 @@ dir_s_open(klass, dirname)
dir_initialize(dir, dirname);
if (rb_block_given_p()) {
- rb_ensure(rb_yield, dir, dir_close, dir);
- return Qnil;
+ return rb_ensure(rb_yield, dir, dir_close, dir);
}
return dir;