summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2021-09-17 12:12:08 -0700
committergit <svn-admin@ruby-lang.org>2022-01-07 09:42:09 +0900
commitdd6a75195a635abfcfdb8ac5df26885e91708908 (patch)
treeef600f941f1bbab71399bead7917c4dd7d9cef19 /ext
parent6baa78bb78315dfb0bc05e933fe6c512a3a098e6 (diff)
[ruby/pathname] Make Pathname#each_entry return enumerator if called without block
Fixes [Bug #18158] https://github.com/ruby/pathname/commit/914c726aa2
Diffstat (limited to 'ext')
-rw-r--r--ext/pathname/pathname.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/pathname/pathname.c b/ext/pathname/pathname.c
index 1d4ed2814b..00ca85205b 100644
--- a/ext/pathname/pathname.c
+++ b/ext/pathname/pathname.c
@@ -1274,6 +1274,7 @@ static VALUE
path_each_entry(VALUE self)
{
VALUE args[1];
+ RETURN_ENUMERATOR(self, 0, 0);
args[0] = get_strpath(self);
return rb_block_call(rb_cDir, id_foreach, 1, args, each_entry_i, rb_obj_class(self));