summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-03-28 08:43:25 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-03-28 08:43:25 +0000
commit62261ccb47fce9c4728cfbeb84f81d23369ab910 (patch)
tree3f1464728d4c6d3ba1e64bbe22e1f00672a8690a /dir.c
parent6771ffa97125d57a48378daed460ec22db7dd835 (diff)
* object.c (rb_str2cstr): warn if string contains \0 and length
value is ignored. * class.c (rb_singleton_class_clone): should copy class constant table as well. * class.c (rb_include_module): sometimes cache was mistakenly left uncleared - based on the patch by K.Kosako. * ruby.h: all Check_SafeStr()'s are replaced by SafeStr() to ensure 'to_str' be always effective. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/dir.c b/dir.c
index a1b14348f2..0ef70c6d10 100644
--- a/dir.c
+++ b/dir.c
@@ -254,7 +254,7 @@ dir_initialize(dir, dirname)
{
DIR *dirp;
- Check_SafeStr(dirname);
+ SafeStr(dirname);
if (DATA_PTR(dir)) closedir(DATA_PTR(dir));
DATA_PTR(dir) = NULL;
dirp = opendir(RSTRING(dirname)->ptr);
@@ -425,7 +425,7 @@ dir_s_chdir(argc, argv, obj)
rb_secure(2);
if (rb_scan_args(argc, argv, "01", &path) == 1) {
- Check_SafeStr(path);
+ SafeStr(path);
dist = RSTRING(path)->ptr;
}
else {
@@ -467,7 +467,7 @@ dir_s_chroot(dir, path)
{
#if defined(HAVE_CHROOT) && !defined(__CHECKER__)
rb_secure(2);
- Check_SafeStr(path);
+ SafeStr(path);
if (chroot(RSTRING(path)->ptr) == -1)
rb_sys_fail(RSTRING(path)->ptr);
@@ -495,7 +495,7 @@ dir_s_mkdir(argc, argv, obj)
mode = 0777;
}
- Check_SafeStr(path);
+ SafeStr(path);
rb_secure(2);
#if !defined(NT)
if (mkdir(RSTRING(path)->ptr, mode) == -1)
@@ -512,7 +512,7 @@ static VALUE
dir_s_rmdir(obj, dir)
VALUE obj, dir;
{
- Check_SafeStr(dir);
+ SafeStr(dir);
rb_secure(2);
if (rmdir(RSTRING(dir)->ptr) < 0)
rb_sys_fail(RSTRING(dir)->ptr);
@@ -853,7 +853,7 @@ dir_s_glob(dir, str)
int nest;
VALUE ary = 0;
- Check_SafeStr(str);
+ SafeStr(str);
if (!rb_block_given_p()) {
ary = rb_ary_new();
}