summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-05-12 09:07:57 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-05-12 09:07:57 +0000
commitdce6fa05661b0002f5ef38292b3a839113b80346 (patch)
tree060ec81a34e5024a8b70372f4130de878eb87002 /ruby.c
parent2e71826ac4c6033716fd502fb45161ea953b26bd (diff)
2000-05-12
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_4@687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/ruby.c b/ruby.c
index 9dc9ea8a42..52e47e2935 100644
--- a/ruby.c
+++ b/ruby.c
@@ -636,6 +636,12 @@ load_file(fname, script)
while (p < pend && !ISSPACE(*p))
p++;
*p++ = '\0';
+ if (rb_safe_level() == 0) {
+ rb_ary_push(rb_load_path, rb_str_new2("."));
+ addpath(getenv("RUBYLIB"));
+ }
+
+
if (p < pend) {
argv = ALLOCA_N(char*, origargc+3);
argv[1] = p;
@@ -856,10 +862,6 @@ ruby_prog_init()
rb_define_readonly_variable("$-p", &do_print);
rb_define_readonly_variable("$-l", &do_line);
- if (rb_safe_level() == 0) {
- addpath(".");
- }
-
addpath(RUBY_LIB);
#if defined(_WIN32) || defined(DJGPP)
addpath(ruby_libpath());
@@ -881,10 +883,6 @@ ruby_prog_init()
addpath(RUBY_SEARCH_PATH);
#endif
- if (rb_safe_level() == 0) {
- addpath(getenv("RUBYLIB"));
- }
-
rb_define_hooked_variable("$0", &rb_progname, 0, set_arg0);
rb_argv = rb_ary_new();