summaryrefslogtreecommitdiff
path: root/lib/tmpdir.rb
diff options
context:
space:
mode:
authornagachika <nagachika@ruby-lang.org>2020-07-23 11:16:31 +0900
committernagachika <nagachika@ruby-lang.org>2020-07-23 11:16:31 +0900
commit13d2ab0d88bbf72ed310efaec6edc46dd96fdb4d (patch)
treeadc31b2d36e636e9e977ba9007a05a39aff0d341 /lib/tmpdir.rb
parentcc39480cf9f2767967b6bcc69ccb3c201e5b2231 (diff)
merge revision(s) 2ecfb88ee50510955acd3ae9fc94a5f109e7f109: [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]
Diffstat (limited to 'lib/tmpdir.rb')
-rw-r--r--lib/tmpdir.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/tmpdir.rb b/lib/tmpdir.rb
index ea1d380ef1..1bbf7ea46a 100644
--- a/lib/tmpdir.rb
+++ b/lib/tmpdir.rb
@@ -86,7 +86,7 @@ class Dir
}
if block_given?
begin
- yield path
+ yield path.dup
ensure
unless base
stat = File.stat(File.dirname(path))