From 2ecfb88ee50510955acd3ae9fc94a5f109e7f109 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Thu, 28 May 2020 19:49:10 -0700 Subject: 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') diff --git a/lib/tmpdir.rb b/lib/tmpdir.rb index c61365577e..e6cb327fc7 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