From 34768ea9df63abd5fd9b10553bbd23da52365018 Mon Sep 17 00:00:00 2001 From: usa Date: Tue, 2 Mar 2021 11:37:36 +0000 Subject: merge revision(s) 2ecfb88e: [Backport #16918] Correctly remove temporary directory if path yielded is mutated Another approach would be to freeze the string, but that could cause backwards compatibility issues. Fixes [Bug #16918] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/tmpdir.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/tmpdir.rb b/lib/tmpdir.rb index 87e53a83be..9d61595ec2 100644 --- a/lib/tmpdir.rb +++ b/lib/tmpdir.rb @@ -90,7 +90,7 @@ class Dir } if block_given? begin - yield path + yield path.dup ensure unless base stat = File.stat(File.dirname(path)) -- cgit v1.2.3