mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ruby.c (require_libraries): use require method instead of calling
rb_require directly. [ruby-dev:31322] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b9b34059a6
commit
014d1ae20d
2 changed files with 9 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Mon Oct 1 10:58:42 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* ruby.c (require_libraries): use require method instead of calling
|
||||||
|
rb_require directly. [ruby-dev:31322]
|
||||||
|
|
||||||
Mon Oct 1 10:52:30 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Mon Oct 1 10:52:30 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* eval.c (ruby_options), ruby.c (proc_options, process_options): not
|
* eval.c (ruby_options), ruby.c (proc_options, process_options): not
|
||||||
|
|
9
ruby.c
9
ruby.c
|
@ -413,25 +413,24 @@ add_modules(const char *mod)
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void Init_ext(void);
|
extern void Init_ext(void);
|
||||||
|
extern VALUE rb_vm_top_self(void);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
require_libraries(void)
|
require_libraries(void)
|
||||||
{
|
{
|
||||||
struct req_list *list = req_list.head.next;
|
struct req_list *list = req_list.head.next;
|
||||||
struct req_list *tmp;
|
struct req_list *tmp;
|
||||||
|
ID require = rb_intern("require");
|
||||||
|
|
||||||
Init_ext(); /* should be called here for some reason :-( */
|
Init_ext(); /* should be called here for some reason :-( */
|
||||||
req_list.last = 0;
|
req_list.last = 0;
|
||||||
while (list) {
|
while (list) {
|
||||||
int state;
|
VALUE feature = rb_str_new2(list->name);
|
||||||
|
|
||||||
rb_protect((VALUE (*)(VALUE))rb_require, (VALUE)list->name, &state);
|
|
||||||
if (state)
|
|
||||||
rb_jump_tag(state);
|
|
||||||
tmp = list->next;
|
tmp = list->next;
|
||||||
free(list->name);
|
free(list->name);
|
||||||
free(list);
|
free(list);
|
||||||
list = tmp;
|
list = tmp;
|
||||||
|
rb_funcall2(rb_vm_top_self(), require, 1, &feature);
|
||||||
}
|
}
|
||||||
req_list.head.next = 0;
|
req_list.head.next = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue