diff --git a/ChangeLog b/ChangeLog index ce83032a63..351b1d18a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Jan 10 09:18:03 2006 Nobuyoshi Nakada + + * eval.c (rb_require_safe): prevent extension from loading twice. + fixed: [ruby-dev:29523] + Sat Sep 9 23:55:28 2006 Yukihiro Matsumoto * file.c (rb_f_test): test(0) should not have any special diff --git a/eval.c b/eval.c index 66347120c1..7bc11350c1 100644 --- a/eval.c +++ b/eval.c @@ -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;