diff --git a/ChangeLog b/ChangeLog index 50dd71eddf..35a1bea350 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Tue Jul 18 14:58:30 2000 Yukihiro Matsumoto + + * eval.c (ruby_options): should treat SystemExit etc. properly. + + * parse.y (yycompile): should check compile_for_eval, not + ruby_in_eval. + Mon Jul 17 04:29:50 2000 Minero Aoki * lib/mkmf.rb: converts extention of $objs into $OBJEXT. diff --git a/eval.c b/eval.c index 70051cab9c..24a7298387 100644 --- a/eval.c +++ b/eval.c @@ -1002,26 +1002,6 @@ ruby_init() ruby_scope = top_scope; } -void -ruby_options(argc, argv) - int argc; - char **argv; -{ - int state; - - PUSH_TAG(PROT_NONE) - if ((state = EXEC_TAG()) == 0) { - ruby_process_options(argc, argv); - } - POP_TAG(); - if (state) { - trace_func = 0; - tracing = 0; - error_print(); - exit(1); - } -} - static VALUE eval_node(self) VALUE self; @@ -1099,6 +1079,25 @@ error_handle(ex) return ex; } +void +ruby_options(argc, argv) + int argc; + char **argv; +{ + int state; + + PUSH_TAG(PROT_NONE) + if ((state = EXEC_TAG()) == 0) { + ruby_process_options(argc, argv); + } + POP_TAG(); + if (state) { + trace_func = 0; + tracing = 0; + exit(error_handle(state)); + } +} + void ruby_run() { diff --git a/lib/complex.rb b/lib/complex.rb index 56dd040ac1..733e4530e3 100644 --- a/lib/complex.rb +++ b/lib/complex.rb @@ -500,5 +500,3 @@ module Math module_function :atanh! end - - diff --git a/lib/debug.rb b/lib/debug.rb index d20d1ebbfc..71fe830475 100644 --- a/lib/debug.rb +++ b/lib/debug.rb @@ -578,6 +578,7 @@ EOHELP end def excn_handle(file, line, id, binding) + p $! if $!.type <= SystemExit set_trace_func nil exit diff --git a/lib/ping.rb b/lib/ping.rb index 065b1d2303..48657818cc 100644 --- a/lib/ping.rb +++ b/lib/ping.rb @@ -38,9 +38,9 @@ #=end require 'timeout' +require "socket" module Ping - require "socket" def pingecho(host, timeout=5, service="echo") begin timeout(timeout) do diff --git a/lib/weakref.rb b/lib/weakref.rb index 3307a2e5aa..9e510d6f1c 100644 --- a/lib/weakref.rb +++ b/lib/weakref.rb @@ -43,8 +43,8 @@ class WeakRef