summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2021-03-02 11:37:36 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2021-03-02 11:37:36 +0000
commit34768ea9df63abd5fd9b10553bbd23da52365018 (patch)
treec578f11f0b4b63921357b7480be252578d2c4b48 /lib
parenta175a30ab9d79b759fa17e71506caef896a4540e (diff)
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
Diffstat (limited to 'lib')
-rw-r--r--lib/tmpdir.rb2
1 files changed, 1 insertions, 1 deletions
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))