mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
77f8b0db8d
commit
e4fae8da4b
7 changed files with 45 additions and 10 deletions
|
@ -1,3 +1,8 @@
|
|||
Sat Sep 23 03:06:25 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* variable.c (rb_autoload_load): should not require already
|
||||
provided features.
|
||||
|
||||
Fri Sep 22 15:46:21 2000 Minero Aoki <aamine@dp.u-netsurf.ne.jp>
|
||||
|
||||
* lib/net/http.rb: too early parameter expantion in string.
|
||||
|
|
|
@ -913,8 +913,9 @@ RUBY_LIB_PATH="${RUBY_LIB_PREFIX}/${MAJOR}.${MINOR}"
|
|||
sitedir='${prefix}/lib/ruby/site_ruby'
|
||||
AC_ARG_WITH(sitedir,
|
||||
[--with-sitedir=DIR site libraries in DIR [PREFIX/lib/ruby/site_ruby]],
|
||||
[sitedir=$withval])
|
||||
RUBY_SITE_LIB_PATH=`eval "echo ${SITEDIR}"`
|
||||
[sitedir=$withval],
|
||||
[sitedir=`eval "echo ${SITEDIR}"`])
|
||||
RUBY_SITE_LIB_PATH="${sitedir}"
|
||||
RUBY_SITE_LIB_PATH2="${RUBY_SITE_LIB_PATH}/${MAJOR}.${MINOR}"
|
||||
|
||||
AC_DEFINE_UNQUOTED(RUBY_LIB, "${RUBY_LIB_PATH}")
|
||||
|
|
18
eval.c
18
eval.c
|
@ -5025,8 +5025,9 @@ static VALUE rb_features;
|
|||
static st_table *loading_tbl;
|
||||
|
||||
static int
|
||||
rb_provided(feature)
|
||||
rb_feature_p(feature, wait)
|
||||
const char *feature;
|
||||
int wait;
|
||||
{
|
||||
VALUE *p, *pend;
|
||||
char *f;
|
||||
|
@ -5045,7 +5046,8 @@ rb_provided(feature)
|
|||
return Qtrue;
|
||||
}
|
||||
if (strcmp(f+len, ".rb") == 0) {
|
||||
goto load_wait;
|
||||
if (wait) goto load_wait;
|
||||
return Qtrue;
|
||||
}
|
||||
}
|
||||
p++;
|
||||
|
@ -5070,6 +5072,13 @@ rb_provided(feature)
|
|||
return Qtrue;
|
||||
}
|
||||
|
||||
int
|
||||
rb_provided(feature)
|
||||
const char *feature;
|
||||
{
|
||||
return rb_feature_p(feature, Qfalse);
|
||||
}
|
||||
|
||||
void
|
||||
rb_provide(feature)
|
||||
const char *feature;
|
||||
|
@ -5088,7 +5097,7 @@ rb_provide(feature)
|
|||
strcpy(ext, ".so");
|
||||
feature = buf;
|
||||
}
|
||||
if (rb_provided(feature)) return;
|
||||
if (rb_feature_p(feature, Qtrue)) return;
|
||||
rb_ary_push(rb_features, rb_str_new2(feature));
|
||||
}
|
||||
|
||||
|
@ -5102,7 +5111,8 @@ rb_f_require(obj, fname)
|
|||
volatile int safe = ruby_safe_level;
|
||||
|
||||
Check_SafeStr(fname);
|
||||
if (rb_provided(RSTRING(fname)->ptr)) return Qfalse;
|
||||
if (rb_feature_p(RSTRING(fname)->ptr, Qtrue))
|
||||
return Qfalse;
|
||||
ext = strrchr(RSTRING(fname)->ptr, '.');
|
||||
if (ext) {
|
||||
feature = file = RSTRING(fname)->ptr;
|
||||
|
|
|
@ -18,10 +18,16 @@ tcllib = with_config("tcllib")
|
|||
stubs = enable_config("tcltk_stubs") || with_config("tcltk_stubs")
|
||||
|
||||
def find_tcl(tcllib, stubs)
|
||||
paths = ["/usr/local/lib", "/usr/pkg"]
|
||||
paths = ["/usr/local/lib", "/usr/pkg", "/usr/lib"]
|
||||
func = stubs ? "Tcl_InitStubs" : "Tcl_FindExecutable"
|
||||
if tcllib
|
||||
find_library(tcllib, func, *paths)
|
||||
elsif RUBY_PLATFORM =~ /mswin32|mingw|cygwin/
|
||||
find_library("tcl", func, *paths) or
|
||||
find_library("tcl83", func, *paths) or
|
||||
find_library("tcl82", func, *paths) or
|
||||
find_library("tcl80", func, *paths) or
|
||||
find_library("tcl76", func, *paths)
|
||||
else
|
||||
find_library("tcl", func, *paths) or
|
||||
find_library("tcl8.3", func, *paths) or
|
||||
|
@ -32,10 +38,16 @@ def find_tcl(tcllib, stubs)
|
|||
end
|
||||
|
||||
def find_tk(tklib, stubs)
|
||||
paths = ["/usr/local/lib", "/usr/pkg"]
|
||||
paths = ["/usr/local/lib", "/usr/pkg", "/usr/lib"]
|
||||
func = stubs ? "Tk_InitStubs" : "Tk_Init"
|
||||
if tklib
|
||||
find_library(tklib, func, *paths)
|
||||
elsif RUBY_PLATFORM =~ /mswin32|mingw|cygwin/
|
||||
find_library("tk", func, *paths) or
|
||||
find_library("tk83", func, *paths) or
|
||||
find_library("tk82", func, *paths) or
|
||||
find_library("tk80", func, *paths) or
|
||||
find_library("tk42", func, *paths)
|
||||
else
|
||||
find_library("tk", func, *paths) or
|
||||
find_library("tk8.3", func, *paths) or
|
||||
|
|
1
intern.h
1
intern.h
|
@ -132,6 +132,7 @@ VALUE rb_obj_instance_eval _((int, VALUE*, VALUE));
|
|||
void rb_load _((VALUE, int));
|
||||
void rb_load_protect _((VALUE, int, int*));
|
||||
void rb_jump_tag _((int)) NORETURN;
|
||||
int rb_provided _((const char*));
|
||||
void rb_provide _((const char*));
|
||||
VALUE rb_f_require _((VALUE, VALUE));
|
||||
void rb_obj_call_init _((VALUE, int, VALUE*));
|
||||
|
|
6
parse.y
6
parse.y
|
@ -1204,12 +1204,13 @@ primary : literal
|
|||
class_nest++;
|
||||
cref_push();
|
||||
local_push();
|
||||
$<num>$ = ruby_sourceline;
|
||||
}
|
||||
compstmt
|
||||
kEND
|
||||
{
|
||||
$$ = NEW_CLASS($2, $5, $3);
|
||||
fixpos($$, $3);
|
||||
nd_set_line($$, $<num>4);
|
||||
local_pop();
|
||||
cref_pop();
|
||||
class_nest--;
|
||||
|
@ -1236,12 +1237,13 @@ primary : literal
|
|||
class_nest++;
|
||||
cref_push();
|
||||
local_push();
|
||||
$<num>$ = ruby_sourceline;
|
||||
}
|
||||
compstmt
|
||||
kEND
|
||||
{
|
||||
$$ = NEW_MODULE($2, $4);
|
||||
fixpos($$, $4);
|
||||
nd_set_line($$, $<num>3);
|
||||
local_pop();
|
||||
cref_pop();
|
||||
class_nest--;
|
||||
|
|
|
@ -1053,6 +1053,10 @@ rb_autoload_load(id)
|
|||
VALUE module;
|
||||
|
||||
st_delete(autoload_tbl, &id, &modname);
|
||||
if (rb_provided(modname)) {
|
||||
free(modname);
|
||||
return;
|
||||
}
|
||||
module = rb_str_new2(modname);
|
||||
free(modname);
|
||||
FL_UNSET(module, FL_TAINT);
|
||||
|
|
Loading…
Add table
Reference in a new issue