зеркало из https://github.com/github/ruby.git
* load.c (rb_require_safe): should check fname path after $SAFE is
properly set. [ruby-dev:34268] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
7dc26509c6
Коммит
502e19fd10
|
@ -1,3 +1,8 @@
|
|||
Tue Apr 8 10:34:10 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* load.c (rb_require_safe): should check fname path after $SAFE is
|
||||
properly set. [ruby-dev:34268]
|
||||
|
||||
Tue Apr 8 10:30:29 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* common.mk (prelude.c): depends on enc/prelude.rb.
|
||||
|
|
4
load.c
4
load.c
|
@ -520,8 +520,6 @@ rb_require_safe(VALUE fname, int safe)
|
|||
} volatile saved;
|
||||
char *volatile ftptr = 0;
|
||||
|
||||
FilePathValue(fname);
|
||||
RB_GC_GUARD(fname) = rb_str_new4(fname);
|
||||
PUSH_TAG();
|
||||
saved.safe = rb_safe_level();
|
||||
if ((state = EXEC_TAG()) == 0) {
|
||||
|
@ -530,6 +528,8 @@ rb_require_safe(VALUE fname, int safe)
|
|||
int found;
|
||||
|
||||
rb_set_safe_level_force(safe);
|
||||
FilePathValue(fname);
|
||||
RB_GC_GUARD(fname) = rb_str_new4(fname);
|
||||
found = search_required(fname, &path);
|
||||
if (found) {
|
||||
if (!path || !(ftptr = load_lock(RSTRING_PTR(path)))) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче