summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authorYukihiro Matsumoto <matz@ruby-lang.org>1997-10-03 10:51:10 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2019-08-17 22:09:33 +0900
commit7ad198827b6029d5338c6a2dfe68248da25e9db5 (patch)
tree2fc097b92bcbb5daba091852b40ef1c2640bb457 /eval.c
parent10d21745c8c1c3c78678ea7e0b62c0a7433ccfce (diff)
version 1.0-971003v1_0_971003
https://cache.ruby-lang.org/pub/ruby/1.0/ruby-1.0-971003.tar.gz Fri Oct 3 10:51:10 1997 Yukihiro Matsumoto <matz@netlab.co.jp> * version 1.0-971003 * eval.c (ruby_options): f_require() called too early. * eval.c (rb_provide): module extentions should always be `.o'.
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