diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tmpdir.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/tmpdir.rb b/lib/tmpdir.rb index d12afa1ae6..13ed580eb4 100644 --- a/lib/tmpdir.rb +++ b/lib/tmpdir.rb @@ -109,8 +109,10 @@ class Dir def make_tmpname((prefix, suffix), n) prefix = (String.try_convert(prefix) or raise ArgumentError, "unexpected prefix: #{prefix.inspect}") + prefix = prefix.delete("#{File::SEPARATOR}#{File::ALT_SEPARATOR}") suffix &&= (String.try_convert(suffix) or raise ArgumentError, "unexpected suffix: #{suffix.inspect}") + suffix &&= suffix.delete("#{File::SEPARATOR}#{File::ALT_SEPARATOR}") t = Time.now.strftime("%Y%m%d") path = "#{prefix}#{t}-#{$$}-#{rand(0x100000000).to_s(36)}".dup path << "-#{n}" if n |