ruby-changes:2088
From: ko1@a...
Date: 1 Oct 2007 10:52:57 +0900
Subject: [ruby-changes:2088] nobu - Ruby:r13579 (trunk): * eval.c (ruby_options), ruby.c (proc_options, process_options): not
nobu 2007-10-01 10:52:32 +0900 (Mon, 01 Oct 2007)
New Revision: 13579
Modified files:
trunk/ChangeLog
trunk/eval.c
trunk/ruby.c
trunk/version.h
Log:
* eval.c (ruby_options), ruby.c (proc_options, process_options): not
call exit(2) directly. [ruby-dev:31912]
* eval.c (ruby_run_node): deal with direct exit code.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/version.h?r1=13579&r2=13578
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ruby.c?r1=13579&r2=13578
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=13579&r2=13578
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/eval.c?r1=13579&r2=13578
Index: ChangeLog
===================================================================
--- ChangeLog (revision 13578)
+++ ChangeLog (revision 13579)
@@ -1,3 +1,10 @@
+Mon Oct 1 10:52:30 2007 Nobuyoshi Nakada <nobu@r...>
+
+ * eval.c (ruby_options), ruby.c (proc_options, process_options): not
+ call exit(2) directly. [ruby-dev:31912]
+
+ * eval.c (ruby_run_node): deal with direct exit code.
+
Sun Sep 30 17:12:53 2007 Nobuyoshi Nakada <nobu@r...>
* string.c (rb_str_append): always set encoding, and coderange
Index: eval.c
===================================================================
--- eval.c (revision 13578)
+++ eval.c (revision 13579)
@@ -121,7 +121,8 @@
}
else {
rb_clear_trace_func();
- exit(error_handle(state));
+ state = error_handle(state);
+ tree = (void *)INT2FIX(state);
}
POP_TAG();
return tree;
@@ -249,9 +250,14 @@
ruby_run_node(void *n)
{
NODE *node = (NODE *)n;
- if (!n) {
- return EXIT_FAILURE;
+
+ switch ((VALUE)n) {
+ case Qtrue: return EXIT_SUCCESS;
+ case Qfalse: return EXIT_FAILURE;
}
+ if (FIXNUM_P((VALUE)n)) {
+ return FIX2INT((VALUE)n);
+ }
Init_stack((void *)&n);
return ruby_cleanup(ruby_exec_node(node, node->nd_file));
}
@@ -964,6 +970,7 @@
for (;;) {
rb_yield_0(0, 0);
}
+ return Qnil;
}
/*
Index: version.h
===================================================================
--- version.h (revision 13578)
+++ version.h (revision 13579)
@@ -1,15 +1,15 @@
#define RUBY_VERSION "1.9.0"
-#define RUBY_RELEASE_DATE "2007-09-30"
+#define RUBY_RELEASE_DATE "2007-10-01"
#define RUBY_VERSION_CODE 190
-#define RUBY_RELEASE_CODE 20070930
+#define RUBY_RELEASE_CODE 20071001
#define RUBY_PATCHLEVEL 0
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 9
#define RUBY_VERSION_TEENY 0
#define RUBY_RELEASE_YEAR 2007
-#define RUBY_RELEASE_MONTH 9
-#define RUBY_RELEASE_DAY 30
+#define RUBY_RELEASE_MONTH 10
+#define RUBY_RELEASE_DAY 1
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];
Index: ruby.c
===================================================================
--- ruby.c (revision 13578)
+++ ruby.c (revision 13579)
@@ -614,7 +614,8 @@
case 'h':
usage(origarg.argv[0]);
- exit(0);
+ rb_exit(EXIT_SUCCESS);
+ break;
case 'l':
opt->do_line = Qtrue;
@@ -787,7 +788,7 @@
ruby_yydebug = 1;
else if (strcmp("help", s) == 0) {
usage(origarg.argv[0]);
- exit(0);
+ rb_exit(EXIT_SUCCESS);
}
else {
rb_raise(rb_eRuntimeError,
@@ -873,7 +874,7 @@
if (opt->version) {
ruby_show_version();
- exit(0);
+ return (NODE *)Qtrue;
}
if (opt->copyright) {
ruby_show_copyright();
@@ -887,7 +888,7 @@
if (!opt->e_script) {
if (argc == 0) { /* no more args */
if (opt->verbose)
- return 0;
+ return (NODE *)Qtrue;
opt->script = "-";
}
else {
@@ -1311,7 +1312,6 @@
struct cmdline_options opt;
NODE *tree;
-
MEMZERO(&opt, opt, 1);
ruby_script(argv[0]); /* for the time being */
rb_argv0 = rb_progname;
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml