summaryrefslogtreecommitdiff
path: root/lib/tmpdir.rb
diff options
context:
space:
mode:
authornagachika <nagachika@ruby-lang.org>2021-04-05 20:35:34 +0900
committernagachika <nagachika@ruby-lang.org>2021-04-05 20:48:25 +0900
commit59cfa0b1346067e36ae11fc6c317693ce4b9833a (patch)
tree021b265720b501f26e9b134289949d4f04abfe48 /lib/tmpdir.rb
parentb59e5a64be40b93370afbb0accfcb73c4d682045 (diff)
Backport a tmpdir fix.
Remove other then alphanumeric and some punctuations considered filesystem-safe, instead of removing some unsafe chars only.
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 1bbf7ea46a..5e42e8e302 100644
--- a/lib/tmpdir.rb
+++ b/lib/tmpdir.rb
@@ -108,7 +108,7 @@ class Dir
Dir.tmpdir
end
- UNUSABLE_CHARS = [File::SEPARATOR, File::ALT_SEPARATOR, File::PATH_SEPARATOR, ":"].uniq.join("").freeze
+ UNUSABLE_CHARS = "^,-.0-9A-Z_a-z~"
def create(basename, tmpdir=nil, max_try: nil, **opts)
origdir = tmpdir