summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/eval.c b/eval.c
index 564ff9a7ad..fdc338b504 100644
--- a/eval.c
+++ b/eval.c
@@ -675,13 +675,14 @@ ruby_options(argc, argv)
PUSH_TAG()
if ((state = EXEC_TAG()) == 0) {
- NODE *save = eval_tree;
+ NODE *save;
Init_ext();
ext_init = 1;
+ ruby_process_options(argc, argv);
+ save = eval_tree;
rb_require_modules();
eval_tree = save;
- ruby_process_options(argc, argv);
}
POP_TAG();
if (state) error_print();
@@ -3537,8 +3538,19 @@ void
rb_provide(feature)
char *feature;
{
- if (!rb_provided(feature))
+ char *buf, *ext;
+
+ if (!rb_provided(feature)) {
+ ext = strrchr(feature, '.');
+ if (strcmp(DLEXT, ext) == 0) {
+ buf = ALLOCA_N(char, strlen(feature)+1);
+ strcpy(buf, feature);
+ ext = strrchr(buf, '.');
+ strcpy(ext, ".o");
+ feature = buf;
+ }
ary_push(rb_features, str_new2(feature));
+ }
}
VALUE