summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-30 12:45:40 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-30 12:45:40 +0000
commit82c6f54b162d65c39bc0a8b4d35c9d9c2837f23a (patch)
treea86c3ec86f441e234b0776c248e6d5d3df227ac6 /file.c
parent58f7f54c6c105870ed2d807721c10557687374ec (diff)
merges r25290 from trunk into ruby_1_9_1.
-- * file.c (path_check_0): prevent from GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@26478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/file.c b/file.c
index 3a023561ef..553919a574 100644
--- a/file.c
+++ b/file.c
@@ -4405,7 +4405,8 @@ path_check_0(VALUE path, int execpath)
rb_str_cat2(newpath, "/");
rb_str_cat2(newpath, p0);
- p0 = RSTRING_PTR(path = newpath);
+ path = newpath;
+ p0 = RSTRING_PTR(newpath);
}
for (;;) {
#ifndef S_IWOTH
@@ -4419,6 +4420,7 @@ path_check_0(VALUE path, int execpath)
rb_warn("Insecure world writable dir %s in %sPATH, mode 0%o",
p0, (execpath ? "" : "LOAD_"), st.st_mode);
if (p) *p = '/';
+ RB_GC_GUARD(path);
return 0;
}
s = strrdirsep(p0);