diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-10 00:18:39 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-10 00:18:39 +0000 |
commit | 36e79167ab7a763a0733eec7c69689bce9417afd (patch) | |
tree | 9c6052b61b7e3c5f993546dc45f96a3bb62b724a /eval.c | |
parent | 4569783b2c2b2cb0dbc036dac06890132da03602 (diff) | |
download | ruby-36e79167ab7a763a0733eec7c69689bce9417afd.tar.gz |
* eval.c (rb_require_safe): prevent extension from loading twice.
fixed: [ruby-dev:29523]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -7068,15 +7068,15 @@ rb_require_safe(VALUE fname, int safe) } else { ruby_safe_level = 0; + /* loading ruby library should be serialized. */ + if (!loading_tbl) { + loading_tbl = st_init_strtable(); + } + /* partial state */ + ftptr = ruby_strdup(RSTRING_PTR(path)); + st_insert(loading_tbl, (st_data_t)ftptr, (st_data_t)curr_thread); switch (found) { case 'r': - /* loading ruby library should be serialized. */ - if (!loading_tbl) { - loading_tbl = st_init_strtable(); - } - /* partial state */ - ftptr = ruby_strdup(RSTRING_PTR(path)); - st_insert(loading_tbl, (st_data_t)ftptr, (st_data_t)curr_thread); rb_load(path, 0); break; |