summaryrefslogtreecommitdiffstats
path: root/dir.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-19 08:33:01 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-19 08:33:01 +0000
commit0820c654b26dd36145d1bd394ea58df80fc54918 (patch)
tree41ff49eb0653e30f6bc38db85622553228faf8c0 /dir.c
parent3dd4ff97ccf4d77a781d5523e8f89f8f261d0e4d (diff)
downloadruby-0820c654b26dd36145d1bd394ea58df80fc54918.tar.gz
ruby-0820c654b26dd36145d1bd394ea58df80fc54918.tar.xz
ruby-0820c654b26dd36145d1bd394ea58df80fc54918.zip
* dir.c (GlobPathValue), file.c (rb_get_path_check): path names
must be ASCII compatible. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/dir.c b/dir.c
index 293386349..a71f5825f 100644
--- a/dir.c
+++ b/dir.c
@@ -343,7 +343,10 @@ static VALUE dir_close(VALUE);
/* can contain null bytes as separators */ \
(!RB_TYPE_P(str, T_STRING) ? \
FilePathValue(str) : \
- (safe) ? (rb_check_safe_obj(str), (str)) : (str))
+ (check_safe_glob(str, safe), \
+ check_glob_encoding(str), (str)))
+#define check_safe_glob(str, safe) ((safe) ? rb_check_safe_obj(str) : (void)0)
+#define check_glob_encoding(str) rb_enc_check((str), rb_enc_from_encoding(rb_usascii_encoding()))
static VALUE
dir_s_alloc(VALUE klass)