diff options
Diffstat (limited to 'dir.c')
-rw-r--r-- | dir.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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) |