summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-03-27 06:09:18 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-03-27 06:09:18 +0000
commite933a2791971a5667c52c9f3042aa38179722db2 (patch)
treec077006339525a622df69010013ed2fd4c2e977f
parentc88c96361d4c4e30db4e4078d744cd0b16ac4dcf (diff)
$:, remove top_protected
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog10
-rw-r--r--eval.c9
-rw-r--r--lib/delegate.rb2
-rw-r--r--ruby.c17
4 files changed, 18 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index 362247c1e3..75a856ef55 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Mar 27 13:49:27 1998 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * ruby.c (ruby_prog_init): load-path order changed. Paths in
+ the RUBYLIB environment variable comes first in non-tainted
+ mode.
+
Thu Mar 26 11:51:09 1998 Yukihiro Matsumoto <matz@netlab.co.jp>
* eval.c (rb_call): new feature: `protected' methods.
@@ -17,9 +23,9 @@ Wed Mar 25 08:12:07 1998 Yukihiro Matsumoto <matz@netlab.co.jp>
float value.
* eval.c (f_eval): optional third and fourth argument to specify
- file name and line number.
+ file-name and line-number.
- * eval.c (eval): filename and linenumber set properly.
+ * eval.c (eval): file-name and line-number set properly.
* parse.y (assign_in_cond): literal assignment is now warning, not
compile error.
diff --git a/eval.c b/eval.c
index 1b8a99e275..1e5dcbb9a4 100644
--- a/eval.c
+++ b/eval.c
@@ -4163,14 +4163,6 @@ top_public(argc, argv)
}
static VALUE
-top_protected(argc, argv)
- int argc;
- VALUE *argv;
-{
- return mod_protected(argc, argv, cObject);
-}
-
-static VALUE
top_private(argc, argv)
int argc;
VALUE *argv;
@@ -4436,7 +4428,6 @@ Init_eval()
rb_define_singleton_method(TopSelf, "include", top_include, -1);
rb_define_singleton_method(TopSelf, "public", top_public, -1);
- rb_define_singleton_method(TopSelf, "protected", top_protected, -1);
rb_define_singleton_method(TopSelf, "private", top_private, -1);
rb_define_method(mKernel, "extend", obj_extend, -1);
diff --git a/lib/delegate.rb b/lib/delegate.rb
index 90d1d1abb0..30b1a32c12 100644
--- a/lib/delegate.rb
+++ b/lib/delegate.rb
@@ -20,7 +20,7 @@ class Delegator
end
for method in obj.methods
next if preserved.include? method
- eval "def self.#{method}(*args); __getobj__.__send__(:#{method}, *args){|x|yield}; end"
+ eval "def self.#{method}(*args,&block); __getobj__.__send__(:#{method}, *args,&block); end"
end
end
diff --git a/ruby.c b/ruby.c
index c05154357b..6983791336 100644
--- a/ruby.c
+++ b/ruby.c
@@ -636,6 +636,8 @@ forbid_setid(s)
Fatal("No %s allowed while running setuid", s);
if (egid != gid)
Fatal("No %s allowed while running setgid", s);
+ if (rb_safe_level() > 0)
+ Fatal("No %s allowed in tainted mode", s);
}
#if defined(_WIN32) || defined(DJGPP)
@@ -689,22 +691,21 @@ ruby_prog_init()
addpath(".");
}
+ addpath(RUBY_LIB);
#if defined(_WIN32) || defined(DJGPP)
addpath(ruby_libpath());
#endif
- if (rb_safe_level() == 0) {
- addpath(getenv("RUBYLIB"));
- }
-
+#ifdef RUBY_ARCHLIB
+ addpath(RUBY_ARCHLIB);
+#endif
#ifdef RUBY_THIN_ARCHLIB
addpath(RUBY_THIN_ARCHLIB);
#endif
-#ifdef RUBY_ARCHLIB
- addpath(RUBY_ARCHLIB);
-#endif
- addpath(RUBY_LIB);
+ if (rb_safe_level() == 0) {
+ addpath(getenv("RUBYLIB"));
+ }
rb_define_hooked_variable("$0", &rb_progname, 0, set_arg0);