From 4264ca9436a7b1496dbd6c9ca6e2e043f0c48630 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 7 May 2008 21:43:54 +0000 Subject: * dln.c (dln_find_exe_r, dln_find_file_r): reentrant versions. * file.c (rb_find_file_ext, rb_find_file), process.c (proc_exec_v), (rb_proc_exec, proc_spawn_v, proc_spawn), ruby.c (process_options): use reentrant versions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- file.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'file.c') diff --git a/file.c b/file.c index 4c51c171e8..c614a7e380 100644 --- a/file.c +++ b/file.c @@ -4334,11 +4334,12 @@ rb_find_file_ext(VALUE *filep, const char *const *ext) OBJ_FREEZE(fname); for (i = 0; i < RARRAY_LEN(load_path); i++) { VALUE str = RARRAY_PTR(load_path)[i]; + char fbuf[MAXPATHLEN]; FilePathValue(str); if (RSTRING_LEN(str) == 0) continue; path = RSTRING_PTR(str); - found = dln_find_file(StringValueCStr(fname), path); + found = dln_find_file_r(StringValueCStr(fname), path, fbuf, sizeof(fbuf)); if (found && file_load_ok(found)) { *filep = rb_str_new2(found); return j+1; @@ -4354,6 +4355,7 @@ rb_find_file(VALUE path) VALUE tmp, load_path; char *f = StringValueCStr(path); char *lpath; + char fbuf[MAXPATHLEN]; if (f[0] == '~') { path = rb_file_expand_path(path, Qnil); @@ -4411,7 +4413,7 @@ rb_find_file(VALUE path) if (!lpath) { return 0; /* no path, no load */ } - if (!(f = dln_find_file(f, lpath))) { + if (!(f = dln_find_file_r(f, lpath, fbuf, sizeof(fbuf)))) { return 0; } if (rb_safe_level() >= 1 && !fpath_check(f)) { -- cgit v1.2.3