From 13d2ab0d88bbf72ed310efaec6edc46dd96fdb4d Mon Sep 17 00:00:00 2001 From: nagachika Date: Thu, 23 Jul 2020 11:16:31 +0900 Subject: 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] --- lib/tmpdir.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/tmpdir.rb') 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)) -- cgit v1.2.3