* bcc32/mkexports.rb: to work on cygwin via telnet.
[ruby-win32:358] * ext/tcltklib/tcltklib.c (ip_invoke): requires command name argument. [ruby-dev:18438] * eval.c (ruby_init, ruby_options): Init_stack() with local location. (ruby-bugs-ja:PR#277) * eval.c (rb_call0): disable trace call. [ruby-dev:18074] * eval.c (eval, rb_load): enable trace call. [ruby-dev:18074] * eval.c (rb_f_require): set source file name for extension libraries. [ruby-dev:18445] * ruby.c (translate_char): translate a character in a string; DOSISH only. [ruby-dev:18274] * ruby.c (ruby_init_loadpath): added argv[0] handling under Human68K. [ruby-dev:18274] * ruby.c (proc_options): translate directory separator in $0 to '/'. [ruby-dev:18274] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
29cef5f795
commit
4b6dffad02
27
ChangeLog
27
ChangeLog
@ -1,3 +1,30 @@
|
|||||||
|
Thu Oct 3 20:16:12 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
|
* bcc32/mkexports.rb: to work on cygwin via telnet.
|
||||||
|
[ruby-win32:358]
|
||||||
|
|
||||||
|
* ext/tcltklib/tcltklib.c (ip_invoke): requires command name
|
||||||
|
argument. [ruby-dev:18438]
|
||||||
|
|
||||||
|
* eval.c (ruby_init, ruby_options): Init_stack() with local
|
||||||
|
location. (ruby-bugs-ja:PR#277)
|
||||||
|
|
||||||
|
* eval.c (rb_call0): disable trace call. [ruby-dev:18074]
|
||||||
|
|
||||||
|
* eval.c (eval, rb_load): enable trace call. [ruby-dev:18074]
|
||||||
|
|
||||||
|
* eval.c (rb_f_require): set source file name for extension
|
||||||
|
libraries. [ruby-dev:18445]
|
||||||
|
|
||||||
|
* ruby.c (translate_char): translate a character in a string;
|
||||||
|
DOSISH only. [ruby-dev:18274]
|
||||||
|
|
||||||
|
* ruby.c (ruby_init_loadpath): added argv[0] handling under
|
||||||
|
Human68K. [ruby-dev:18274]
|
||||||
|
|
||||||
|
* ruby.c (proc_options): translate directory separator in $0 to
|
||||||
|
'/'. [ruby-dev:18274]
|
||||||
|
|
||||||
Thu Oct 3 00:27:26 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
Thu Oct 3 00:27:26 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
* lib/delegate.rb (Delegator::initialize): use Object#class
|
* lib/delegate.rb (Delegator::initialize): use Object#class
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
#!./miniruby -s
|
#!./miniruby -s
|
||||||
|
|
||||||
SYM = {}
|
SYM = {}
|
||||||
objs = ARGV.collect {|s| s.tr('/', '\\')}
|
STDIN.reopen(open("nul"))
|
||||||
system("tdump -oiPUBDEF -oiPUBD32 #{objs.join(' ')} > pub.def")
|
ARGV.each do |obj|
|
||||||
sleep(1)
|
IO.foreach("|tdump -q -oiPUBDEF -oiPUBD32 #{obj.tr('/', '\\')}") do |l|
|
||||||
IO.foreach('pub.def'){|l|
|
next unless /(?:PUBDEF|PUBD32)/ =~ l
|
||||||
next unless /(PUBDEF|PUBD32)/ =~ l
|
SYM[$1] = true if /'(.*?)'/ =~ l
|
||||||
/'(.*?)'/ =~ l
|
end
|
||||||
SYM[$1] = true
|
end
|
||||||
}
|
|
||||||
|
|
||||||
exports = []
|
exports = []
|
||||||
if $name
|
if $name
|
||||||
|
25
eval.c
25
eval.c
@ -887,6 +887,8 @@ static void assign _((VALUE,NODE*,VALUE,int));
|
|||||||
static VALUE trace_func = 0;
|
static VALUE trace_func = 0;
|
||||||
static int tracing = 0;
|
static int tracing = 0;
|
||||||
static void call_trace_func _((char*,NODE*,VALUE,ID,VALUE));
|
static void call_trace_func _((char*,NODE*,VALUE,ID,VALUE));
|
||||||
|
#define ENABLE_TRACE() (tracing &= ~2)
|
||||||
|
#define DISABLE_TRACE() (tracing |= 2)
|
||||||
|
|
||||||
#define SET_CURRENT_SOURCE() (ruby_sourcefile = ruby_current_node->nd_file, \
|
#define SET_CURRENT_SOURCE() (ruby_sourcefile = ruby_current_node->nd_file, \
|
||||||
ruby_sourceline = nd_line(ruby_current_node))
|
ruby_sourceline = nd_line(ruby_current_node))
|
||||||
@ -1069,7 +1071,7 @@ ruby_init()
|
|||||||
rb_origenviron = environ;
|
rb_origenviron = environ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Init_stack(0);
|
Init_stack((void*)&state);
|
||||||
Init_heap();
|
Init_heap();
|
||||||
PUSH_SCOPE();
|
PUSH_SCOPE();
|
||||||
ruby_scope->local_vars = 0;
|
ruby_scope->local_vars = 0;
|
||||||
@ -1190,6 +1192,7 @@ ruby_options(argc, argv)
|
|||||||
{
|
{
|
||||||
int state;
|
int state;
|
||||||
|
|
||||||
|
Init_stack((void*)&state);
|
||||||
PUSH_TAG(PROT_NONE);
|
PUSH_TAG(PROT_NONE);
|
||||||
if ((state = EXEC_TAG()) == 0) {
|
if ((state = EXEC_TAG()) == 0) {
|
||||||
ruby_process_options(argc, argv);
|
ruby_process_options(argc, argv);
|
||||||
@ -1866,7 +1869,7 @@ is_defined(self, node, buf)
|
|||||||
}
|
}
|
||||||
check_bound:
|
check_bound:
|
||||||
{
|
{
|
||||||
int call = nd_type(node)== NODE_CALL;
|
int call = nd_type(node)==NODE_CALL;
|
||||||
|
|
||||||
val = CLASS_OF(val);
|
val = CLASS_OF(val);
|
||||||
if (call) {
|
if (call) {
|
||||||
@ -4499,13 +4502,16 @@ rb_call0(klass, recv, id, oid, argc, argv, body, nosuper)
|
|||||||
}
|
}
|
||||||
if (trace_func) {
|
if (trace_func) {
|
||||||
int state;
|
int state;
|
||||||
|
volatile int old_tracing = tracing;
|
||||||
|
|
||||||
call_trace_func("c-call", ruby_current_node, recv, id, klass);
|
call_trace_func("c-call", ruby_current_node, recv, id, klass);
|
||||||
|
DISABLE_TRACE();
|
||||||
PUSH_TAG(PROT_FUNC);
|
PUSH_TAG(PROT_FUNC);
|
||||||
if ((state = EXEC_TAG()) == 0) {
|
if ((state = EXEC_TAG()) == 0) {
|
||||||
result = call_cfunc(body->nd_cfnc, recv, len, argc, argv);
|
result = call_cfunc(body->nd_cfnc, recv, len, argc, argv);
|
||||||
}
|
}
|
||||||
POP_TAG();
|
POP_TAG();
|
||||||
|
tracing = old_tracing;
|
||||||
ruby_current_node = ruby_frame->node;
|
ruby_current_node = ruby_frame->node;
|
||||||
call_trace_func("c-return", ruby_current_node, recv, id, klass);
|
call_trace_func("c-return", ruby_current_node, recv, id, klass);
|
||||||
if (state) JUMP_TAG(state);
|
if (state) JUMP_TAG(state);
|
||||||
@ -4968,6 +4974,7 @@ eval(self, src, scope, file, line)
|
|||||||
struct FRAME frame;
|
struct FRAME frame;
|
||||||
NODE *nodesave = ruby_current_node;
|
NODE *nodesave = ruby_current_node;
|
||||||
volatile int iter = ruby_frame->iter;
|
volatile int iter = ruby_frame->iter;
|
||||||
|
volatile int old_tracing = tracing;
|
||||||
int state;
|
int state;
|
||||||
|
|
||||||
if (!NIL_P(scope)) {
|
if (!NIL_P(scope)) {
|
||||||
@ -5030,6 +5037,7 @@ eval(self, src, scope, file, line)
|
|||||||
compile_error(0);
|
compile_error(0);
|
||||||
}
|
}
|
||||||
if (!NIL_P(result)) ruby_errinfo = result;
|
if (!NIL_P(result)) ruby_errinfo = result;
|
||||||
|
ENABLE_TRACE();
|
||||||
result = eval_node(self, node);
|
result = eval_node(self, node);
|
||||||
}
|
}
|
||||||
POP_TAG();
|
POP_TAG();
|
||||||
@ -5071,6 +5079,7 @@ eval(self, src, scope, file, line)
|
|||||||
}
|
}
|
||||||
ruby_current_node = nodesave;
|
ruby_current_node = nodesave;
|
||||||
ruby_set_current_source();
|
ruby_set_current_source();
|
||||||
|
tracing = old_tracing;
|
||||||
if (state) {
|
if (state) {
|
||||||
if (state == TAG_RAISE) {
|
if (state == TAG_RAISE) {
|
||||||
VALUE err;
|
VALUE err;
|
||||||
@ -5304,6 +5313,7 @@ rb_load(fname, wrap)
|
|||||||
volatile ID last_func;
|
volatile ID last_func;
|
||||||
volatile VALUE wrapper = 0;
|
volatile VALUE wrapper = 0;
|
||||||
volatile VALUE self = ruby_top_self;
|
volatile VALUE self = ruby_top_self;
|
||||||
|
volatile int old_tracing = tracing;
|
||||||
NODE *saved_cref = ruby_cref;
|
NODE *saved_cref = ruby_cref;
|
||||||
TMP_PROTECT;
|
TMP_PROTECT;
|
||||||
|
|
||||||
@ -5357,6 +5367,7 @@ rb_load(fname, wrap)
|
|||||||
node = ruby_eval_tree;
|
node = ruby_eval_tree;
|
||||||
ALLOW_INTS;
|
ALLOW_INTS;
|
||||||
if (ruby_nerrs == 0) {
|
if (ruby_nerrs == 0) {
|
||||||
|
ENABLE_TRACE();
|
||||||
eval_node(self, node);
|
eval_node(self, node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5372,6 +5383,7 @@ rb_load(fname, wrap)
|
|||||||
POP_CLASS();
|
POP_CLASS();
|
||||||
POP_VARS();
|
POP_VARS();
|
||||||
ruby_wrapper = wrapper;
|
ruby_wrapper = wrapper;
|
||||||
|
tracing = old_tracing;
|
||||||
if (ruby_nerrs > 0) {
|
if (ruby_nerrs > 0) {
|
||||||
ruby_nerrs = 0;
|
ruby_nerrs = 0;
|
||||||
rb_exc_raise(ruby_errinfo);
|
rb_exc_raise(ruby_errinfo);
|
||||||
@ -5576,7 +5588,13 @@ rb_f_require(obj, fname)
|
|||||||
rb_provide_feature(feature);
|
rb_provide_feature(feature);
|
||||||
{
|
{
|
||||||
int volatile old_vmode = scope_vmode;
|
int volatile old_vmode = scope_vmode;
|
||||||
|
NODE *const volatile old_node = ruby_current_node;
|
||||||
|
const volatile old_func = ruby_frame->last_func;
|
||||||
|
|
||||||
|
ruby_current_node = 0;
|
||||||
|
ruby_sourcefile = rb_source_filename(RSTRING(fname)->ptr);
|
||||||
|
ruby_sourceline = 0;
|
||||||
|
ruby_frame->last_func = 0;
|
||||||
PUSH_TAG(PROT_NONE);
|
PUSH_TAG(PROT_NONE);
|
||||||
if ((state = EXEC_TAG()) == 0) {
|
if ((state = EXEC_TAG()) == 0) {
|
||||||
void *handle;
|
void *handle;
|
||||||
@ -5586,6 +5604,9 @@ rb_f_require(obj, fname)
|
|||||||
rb_ary_push(ruby_dln_librefs, LONG2NUM((long)handle));
|
rb_ary_push(ruby_dln_librefs, LONG2NUM((long)handle));
|
||||||
}
|
}
|
||||||
POP_TAG();
|
POP_TAG();
|
||||||
|
ruby_current_node = old_node;
|
||||||
|
ruby_set_current_source();
|
||||||
|
ruby_frame->last_func = old_func;
|
||||||
SCOPE_SET(old_vmode);
|
SCOPE_SET(old_vmode);
|
||||||
}
|
}
|
||||||
if (state) JUMP_TAG(state);
|
if (state) JUMP_TAG(state);
|
||||||
|
@ -767,6 +767,9 @@ ip_invoke(argc, argv, obj)
|
|||||||
VALUE *alloc_argv, *alloc_result;
|
VALUE *alloc_argv, *alloc_result;
|
||||||
Tcl_QueuePosition position;
|
Tcl_QueuePosition position;
|
||||||
|
|
||||||
|
if (argc < 1) {
|
||||||
|
rb_raise(rb_eArgError, "command name missing");
|
||||||
|
}
|
||||||
if (eventloop_thread == 0 || current == eventloop_thread) {
|
if (eventloop_thread == 0 || current == eventloop_thread) {
|
||||||
DUMP2("invoke from current eventloop %lx", current);
|
DUMP2("invoke from current eventloop %lx", current);
|
||||||
return ip_invoke_real(argc, argv, obj);
|
return ip_invoke_real(argc, argv, obj);
|
||||||
|
38
ruby.c
38
ruby.c
@ -203,10 +203,30 @@ ruby_incpush(path)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined _WIN32 || defined __CYGWIN__ || defined __DJGPP__ || defined __EMX__
|
#if defined DOSISH || defined __CYGWIN__
|
||||||
#define LOAD_RELATIVE 1
|
#define LOAD_RELATIVE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef DOSISH
|
||||||
|
static inline void translate_char _((char *, int, int));
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
translate_char(p, from, to)
|
||||||
|
char *p;
|
||||||
|
int from, to;
|
||||||
|
{
|
||||||
|
while (*p) {
|
||||||
|
if ((unsigned char)*p == from)
|
||||||
|
*p = to;
|
||||||
|
#ifdef CharNext /* defined as CharNext[AW] on Windows. */
|
||||||
|
p = CharNext(p);
|
||||||
|
#else
|
||||||
|
p += mblen(p, MB_CUR_MAX);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
ruby_init_loadpath()
|
ruby_init_loadpath()
|
||||||
{
|
{
|
||||||
@ -224,19 +244,16 @@ ruby_init_loadpath()
|
|||||||
#elif defined(DJGPP)
|
#elif defined(DJGPP)
|
||||||
extern char *__dos_argv0;
|
extern char *__dos_argv0;
|
||||||
strncpy(libpath, __dos_argv0, FILENAME_MAX);
|
strncpy(libpath, __dos_argv0, FILENAME_MAX);
|
||||||
#define CharNext(p) ((p) + mblen(p, MB_CUR_MAX))
|
#elif defined(__human68k__)
|
||||||
|
extern char **_argv;
|
||||||
|
strncpy(libpath, _argv[0], FILENAME_MAX);
|
||||||
#elif defined(__EMX__)
|
#elif defined(__EMX__)
|
||||||
_execname(libpath, FILENAME_MAX);
|
_execname(libpath, FILENAME_MAX);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CharNext /* defined as CharNext[AW] on Windows. */
|
#ifdef DOSISH
|
||||||
#define CharNext(p) ((p) + 1)
|
translate_char(libpath, '\\', '/');
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (p = libpath; *p; p = CharNext(p))
|
|
||||||
if (*p == '\\')
|
|
||||||
*p = '/';
|
|
||||||
|
|
||||||
p = strrchr(libpath, '/');
|
p = strrchr(libpath, '/');
|
||||||
if (p) {
|
if (p) {
|
||||||
*p = 0;
|
*p = 0;
|
||||||
@ -711,6 +728,9 @@ proc_options(argc, argv)
|
|||||||
if (!e_script) {
|
if (!e_script) {
|
||||||
argc--; argv++;
|
argc--; argv++;
|
||||||
}
|
}
|
||||||
|
#ifdef DOSISH
|
||||||
|
translate_char(script, '\\', '/');
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
ruby_script(script);
|
ruby_script(script);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#define RUBY_VERSION "1.7.3"
|
#define RUBY_VERSION "1.7.3"
|
||||||
#define RUBY_RELEASE_DATE "2002-10-02"
|
#define RUBY_RELEASE_DATE "2002-10-03"
|
||||||
#define RUBY_VERSION_CODE 173
|
#define RUBY_VERSION_CODE 173
|
||||||
#define RUBY_RELEASE_CODE 20021002
|
#define RUBY_RELEASE_CODE 20021003
|
||||||
|
Loading…
x
Reference in New Issue
Block a user