summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ruby.c b/ruby.c
index 004dc1fe90..5f53da2a18 100644
--- a/ruby.c
+++ b/ruby.c
@@ -634,7 +634,7 @@ load_file(fname, script)
char *path;
char *pend = RSTRING(line)->ptr + RSTRING(line)->len;
- p = RSTRING(line)->ptr + 2; /* skip `#!' */
+ p = RSTRING(line)->ptr + 1; /* skip `#!' */
if (pend[-1] == '\n') pend--; /* chomp line */
if (pend[-1] == '\r') pend--;
*pend = '\0';
@@ -884,6 +884,10 @@ ruby_prog_init()
addpath(RUBY_SITE_THIN_ARCHLIB);
#endif
+#ifdef RUBY_SEARCH_PATH
+ addpath(RUBY_SEARCH_PATH);
+#endif
+
if (rb_safe_level() == 0) {
addpath(getenv("RUBYLIB"));
}