Skip to content

Commit

Permalink
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/ruby/stdlib/tmpdir.rb
Original file line number Diff line number Diff line change
@@ -126,7 +126,9 @@ def create(basename, tmpdir=nil, max_try: nil, **opts)
end
n = nil
begin
path = File.join(tmpdir, make_tmpname(basename, n))
# We use the second form here because chdir + ./ files won't open right (http://bugs.jruby.org/3698)
# path = File.join(tmpdir, make_tmpname(basename, n))
path = File.expand_path(make_tmpname(basename, n), tmpdir)
yield(path, n, opts)
rescue Errno::EEXIST
n ||= 0

0 comments on commit 623787b

Please sign in to comment.