From 96b40dff450df701200ea5edceb07f2ed847e3fd Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 17 Feb 2000 07:11:22 +0000 Subject: 2000-02-17 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ruby.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'ruby.c') diff --git a/ruby.c b/ruby.c index 4f87d74818..22bc2b3629 100644 --- a/ruby.c +++ b/ruby.c @@ -108,13 +108,6 @@ NULL printf("\n %s", *p++); } -#ifndef RUBY_LIB -#define RUBY_LIB "/usr/local/lib/ruby" -#endif -#ifndef RUBY_SITE_LIB -#define RUBY_SITE_LIB "/usr/local/lib/site_ruby" -#endif - extern VALUE rb_load_path; #define STATIC_FILE_LENGTH 255 @@ -215,7 +208,7 @@ addpath(path) } struct req_list { - const char *name; + char *name; struct req_list *next; } req_list_head; struct req_list *req_list_last = &req_list_head; @@ -227,7 +220,8 @@ add_modules(mod) struct req_list *list; list = ALLOC(struct req_list); - list->name = mod; + list->name = ALLOC_N(char, strlen(mod)+1); + strcpy(list->name, mod); list->next = 0; req_list_last->next = list; req_list_last = list; @@ -248,6 +242,7 @@ require_libraries() while (list) { rb_require(list->name); tmp = list->next; + free(list->name); free(list); list = tmp; } @@ -745,7 +740,11 @@ load_file(fname, script) } } } - else if (!NIL_P(c)) { + else if (NIL_P(c)) { + rb_io_close(f); + return; + } + else { rb_io_ungetc(f, c); } } @@ -930,17 +929,14 @@ ruby_prog_init() addpath(ruby_libpath()); #endif -#ifdef RUBY_ARCHLIB addpath(RUBY_ARCHLIB); -#endif #ifdef RUBY_THIN_ARCHLIB addpath(RUBY_THIN_ARCHLIB); #endif addpath(RUBY_SITE_LIB); -#ifdef RUBY_SITE_ARCHLIB + addpath(RUBY_SITE_LIB2); addpath(RUBY_SITE_ARCHLIB); -#endif #ifdef RUBY_SITE_THIN_ARCHLIB addpath(RUBY_SITE_THIN_ARCHLIB); #endif -- cgit v1.2.3