summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-09-10 00:18:39 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-09-10 00:18:39 +0000
commit3ba3860f582bbe034e54088cb9c785fc0e64a85f (patch)
tree1a44550cc1a4373f5ff4b0ac010b9e75de0a470e /eval.c
parent28fd8a2d91dfef3ab371cbd5782ef4a7ef44850e (diff)
* eval.c (rb_require_safe): prevent extension from loading twice.
fixed: [ruby-dev:29523] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/eval.c b/eval.c
index 4eeba6f848..fb0160aa93 100644
--- a/eval.c
+++ b/eval.c
@@ -7153,15 +7153,15 @@ rb_require_safe(fname, 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(feature));
+ 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(feature)->ptr);
- st_insert(loading_tbl, (st_data_t)ftptr, (st_data_t)curr_thread);
rb_load(path, 0);
break;