summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-07 21:43:54 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-07 21:43:54 +0000
commit4264ca9436a7b1496dbd6c9ca6e2e043f0c48630 (patch)
tree9c152e1a97a38c069d33785719148e5723278694 /file.c
parent86afcfe4021d3ee7a9d290f2b351ae9e7aa52021 (diff)
* 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
Diffstat (limited to 'file.c')
-rw-r--r--file.c6
1 files changed, 4 insertions, 2 deletions
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)) {