From 82c6f54b162d65c39bc0a8b4d35c9d9c2837f23a Mon Sep 17 00:00:00 2001 From: yugui Date: Sat, 30 Jan 2010 12:45:40 +0000 Subject: 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 --- file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'file.c') 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); -- cgit v1.2.3