summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-05-01 09:41:50 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-05-01 09:41:50 +0000
commit4fa0cdea7838a12afac492ee58af7f30660c6a8f (patch)
tree30895168554835060498505a41c9f5e72c4cddea /file.c
parentca55fe4f0d1477f9b2b14793468c370ebbb96ea7 (diff)
* numeric.c (num_step): better iteration condition for float
values; suggested by Masahiro TANAKA <masa@ir.isas.ac.jp>. * range.c (range_step): step (for Range#step method) <= 0 makes no sence, thus ArgError will be raised. * range.c (range_each): Range#each method is special case for Range#step(1) * file.c (rb_find_file): load must be done from an abolute path if $SAFE >= 4. * enum.c (enum_partition): new method. [new] * re.c (rb_reg_s_quote): quote whitespaces for /x cases. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/file.c b/file.c
index 064cc78259..a54c4ae964 100644
--- a/file.c
+++ b/file.c
@@ -2482,6 +2482,10 @@ rb_find_file(path)
if (file_load_ok(f)) return path;
}
+ if (rb_safe_level() >= 4) {
+ rb_raise(rb_eSecurityError, "loading from non-absolute path %s", f);
+ }
+
if (rb_load_path) {
int i;