* eval.c (rb_eval): pre-evaluate argument for unambiguous

evaluation order.  [ruby-dev:26383]

* lib/delegate.rb (Delegator::method_missing): forward unknown
  method to the destination.  suggested by
  <christophe.poucet@gmail.com>.  [ruby-talk:146776]

* process.c (detach_process_watcher): terminate process watcher
  thread right after rb_waitpid() succeed.  [ruby-talk:146430]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2005-06-30 06:20:09 +00:00
parent 00433666fd
commit 639bd5e78f
10 changed files with 104 additions and 72 deletions

View File

@ -1,3 +1,8 @@
Thu Jun 30 15:13:16 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_eval): pre-evaluate argument for unambiguous
evaluation order. [ruby-dev:26383]
Thu Jun 30 14:48:23 2005 GOTOU Yuuzou <gotoyuzo@notwork.org> Thu Jun 30 14:48:23 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/net/http.rb (Net::HTTP#connect, Net::HTTP#request): should * lib/net/http.rb (Net::HTTP#connect, Net::HTTP#request): should
@ -7,6 +12,12 @@ Thu Jun 30 14:48:23 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/net/http.rb (Net::HTTP::ProxyDelta#edit_path): should not * lib/net/http.rb (Net::HTTP::ProxyDelta#edit_path): should not
send HTTPS scheme URL to origine servers. [ruby-dev:25689] send HTTPS scheme URL to origine servers. [ruby-dev:25689]
Thu Jun 30 09:53:56 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/delegate.rb (Delegator::method_missing): forward unknown
method to the destination. suggested by
<christophe.poucet@gmail.com>. [ruby-talk:146776]
Wed Jun 29 00:03:20 2005 Kazuhiro NISHIYAMA <zn@mbf.nifty.com> Wed Jun 29 00:03:20 2005 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* regparse.c (fetch_token): avoid warning of unused goto tag. * regparse.c (fetch_token): avoid warning of unused goto tag.
@ -27,6 +38,11 @@ Tue Jun 28 01:52:00 2005 NARUSE, Yui <naruse@ruby-lang.org>
* ext/nkf/nkf-utf8/nkf.c: imported Revision 1.69 * ext/nkf/nkf-utf8/nkf.c: imported Revision 1.69
* ext/nkf/nkf-utf8/utf8tbl.c: imported Revision 1.9 * ext/nkf/nkf-utf8/utf8tbl.c: imported Revision 1.9
Sat Jun 25 23:30:51 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* process.c (detach_process_watcher): terminate process watcher
thread right after rb_waitpid() succeed. [ruby-talk:146430]
Sat Jun 25 17:12:20 2005 GOTOU Yuuzou <gotoyuzo@notwork.org> Sat Jun 25 17:12:20 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/webrick/httputils.rb (WEBrick::HTTPUtils.parse_query): should * lib/webrick/httputils.rb (WEBrick::HTTPUtils.parse_query): should
@ -201,6 +217,7 @@ Mon Jun 13 13:03:08 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* hash.c (ruby_setenv): fixed SEGV. [ruby-dev:26186] * hash.c (ruby_setenv): fixed SEGV. [ruby-dev:26186]
>>>>>>> 1.4337
Mon Jun 13 01:54:20 2005 Yukihiro Matsumoto <matz@ruby-lang.org> Mon Jun 13 01:54:20 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* signal.c (sigexit): call rb_thread_signal_exit() instead of * signal.c (sigexit): call rb_thread_signal_exit() instead of

View File

@ -65,10 +65,9 @@ rb_big_clone(x)
return z; return z;
} }
/* modify a bignum by 2's complement */
static void static void
get2comp(x, carry) /* get 2's complement */ get2comp(VALUE x)
VALUE x;
int carry;
{ {
long i = RBIGNUM(x)->len; long i = RBIGNUM(x)->len;
BDIGIT *ds = BDIGITS(x); BDIGIT *ds = BDIGITS(x);
@ -81,11 +80,10 @@ get2comp(x, carry) /* get 2's complement */
ds[i++] = BIGLO(num); ds[i++] = BIGLO(num);
num = BIGDN(num); num = BIGDN(num);
} while (i < RBIGNUM(x)->len); } while (i < RBIGNUM(x)->len);
if (!carry) return; if (num != 0) {
if ((ds[RBIGNUM(x)->len-1] & (1<<(BITSPERDIG-1))) == 0) {
REALLOC_N(RBIGNUM(x)->digits, BDIGIT, ++RBIGNUM(x)->len); REALLOC_N(RBIGNUM(x)->digits, BDIGIT, ++RBIGNUM(x)->len);
ds = BDIGITS(x); ds = BDIGITS(x);
ds[RBIGNUM(x)->len-1] = RBIGNUM(x)->sign ? ~0 : 1; ds[RBIGNUM(x)->len-1] = 1;
} }
} }
@ -93,7 +91,7 @@ void
rb_big_2comp(x) /* get 2's complement */ rb_big_2comp(x) /* get 2's complement */
VALUE x; VALUE x;
{ {
get2comp(x, Qtrue); get2comp(x);
} }
static VALUE static VALUE
@ -1038,6 +1036,8 @@ rb_big_uminus(x)
return bignorm(z); return bignorm(z);
} }
static VALUE bigadd _((VALUE,VALUE,char));
/* /*
* call-seq: * call-seq:
* ~big => integer * ~big => integer
@ -1055,15 +1055,15 @@ rb_big_neg(x)
VALUE x; VALUE x;
{ {
VALUE z = rb_big_clone(x); VALUE z = rb_big_clone(x);
long i = RBIGNUM(x)->len;
BDIGIT *ds = BDIGITS(z); BDIGIT *ds = BDIGITS(z);
long i = RBIGNUM(x)->len;
if (!RBIGNUM(x)->sign) get2comp(z, Qtrue); if (!RBIGNUM(x)->sign) get2comp(z);
while (i--) { while (i--) {
ds[i] = ~ds[i]; ds[i] = ~ds[i];
} }
RBIGNUM(z)->sign = !RBIGNUM(z)->sign; RBIGNUM(z)->sign = !RBIGNUM(z)->sign;
if (RBIGNUM(x)->sign) get2comp(z, Qtrue); if (RBIGNUM(x)->sign) get2comp(z);
return bignorm(z); return bignorm(z);
} }
@ -1655,11 +1655,11 @@ rb_big_and(xx, yy)
} }
if (!RBIGNUM(y)->sign) { if (!RBIGNUM(y)->sign) {
y = rb_big_clone(y); y = rb_big_clone(y);
get2comp(y, Qtrue); get2comp(y);
} }
if (!RBIGNUM(x)->sign) { if (!RBIGNUM(x)->sign) {
x = rb_big_clone(x); x = rb_big_clone(x);
get2comp(x, Qtrue); get2comp(x);
} }
if (RBIGNUM(x)->len > RBIGNUM(y)->len) { if (RBIGNUM(x)->len > RBIGNUM(y)->len) {
l1 = RBIGNUM(y)->len; l1 = RBIGNUM(y)->len;
@ -1684,7 +1684,7 @@ rb_big_and(xx, yy)
for (; i<l2; i++) { for (; i<l2; i++) {
zds[i] = sign?0:ds2[i]; zds[i] = sign?0:ds2[i];
} }
if (!RBIGNUM(z)->sign) get2comp(z, Qtrue); if (!RBIGNUM(z)->sign) get2comp(z);
return bignorm(z); return bignorm(z);
} }
@ -1712,11 +1712,11 @@ rb_big_or(xx, yy)
if (!RBIGNUM(y)->sign) { if (!RBIGNUM(y)->sign) {
y = rb_big_clone(y); y = rb_big_clone(y);
get2comp(y, Qtrue); get2comp(y);
} }
if (!RBIGNUM(x)->sign) { if (!RBIGNUM(x)->sign) {
x = rb_big_clone(x); x = rb_big_clone(x);
get2comp(x, Qtrue); get2comp(x);
} }
if (RBIGNUM(x)->len > RBIGNUM(y)->len) { if (RBIGNUM(x)->len > RBIGNUM(y)->len) {
l1 = RBIGNUM(y)->len; l1 = RBIGNUM(y)->len;
@ -1741,7 +1741,7 @@ rb_big_or(xx, yy)
for (; i<l2; i++) { for (; i<l2; i++) {
zds[i] = sign?ds2[i]:(BIGRAD-1); zds[i] = sign?ds2[i]:(BIGRAD-1);
} }
if (!RBIGNUM(z)->sign) get2comp(z, Qtrue); if (!RBIGNUM(z)->sign) get2comp(z);
return bignorm(z); return bignorm(z);
} }
@ -1771,11 +1771,11 @@ rb_big_xor(xx, yy)
if (!RBIGNUM(y)->sign) { if (!RBIGNUM(y)->sign) {
y = rb_big_clone(y); y = rb_big_clone(y);
get2comp(y, Qtrue); get2comp(y);
} }
if (!RBIGNUM(x)->sign) { if (!RBIGNUM(x)->sign) {
x = rb_big_clone(x); x = rb_big_clone(x);
get2comp(x, Qtrue); get2comp(x);
} }
if (RBIGNUM(x)->len > RBIGNUM(y)->len) { if (RBIGNUM(x)->len > RBIGNUM(y)->len) {
l1 = RBIGNUM(y)->len; l1 = RBIGNUM(y)->len;
@ -1802,7 +1802,7 @@ rb_big_xor(xx, yy)
for (; i<l2; i++) { for (; i<l2; i++) {
zds[i] = sign?ds2[i]:~ds2[i]; zds[i] = sign?ds2[i]:~ds2[i];
} }
if (!RBIGNUM(z)->sign) get2comp(z, Qtrue); if (!RBIGNUM(z)->sign) get2comp(z);
return bignorm(z); return bignorm(z);
} }
@ -1874,7 +1874,7 @@ rb_big_rshift(x, y)
} }
if (!RBIGNUM(x)->sign) { if (!RBIGNUM(x)->sign) {
x = rb_big_clone(x); x = rb_big_clone(x);
get2comp(x, Qtrue); get2comp(x);
} }
xds = BDIGITS(x); xds = BDIGITS(x);
i = RBIGNUM(x)->len; j = i - s1; i = RBIGNUM(x)->len; j = i - s1;
@ -1889,7 +1889,7 @@ rb_big_rshift(x, y)
num = BIGUP(xds[i]); num = BIGUP(xds[i]);
} }
if (!RBIGNUM(x)->sign) { if (!RBIGNUM(x)->sign) {
get2comp(z, Qfalse); get2comp(z);
} }
return bignorm(z); return bignorm(z);
} }
@ -1934,7 +1934,7 @@ rb_big_aref(x, y)
if (!RBIGNUM(x)->sign) { if (!RBIGNUM(x)->sign) {
if (s1 >= RBIGNUM(x)->len) return INT2FIX(1); if (s1 >= RBIGNUM(x)->len) return INT2FIX(1);
x = rb_big_clone(x); x = rb_big_clone(x);
get2comp(x, Qtrue); get2comp(x);
} }
else { else {
if (s1 >= RBIGNUM(x)->len) return INT2FIX(0); if (s1 >= RBIGNUM(x)->len) return INT2FIX(0);

8
eval.c
View File

@ -3287,9 +3287,11 @@ rb_eval(self, n)
case NODE_DOT2: case NODE_DOT2:
case NODE_DOT3: case NODE_DOT3:
result = rb_range_new(rb_eval(self, node->nd_beg), {
rb_eval(self, node->nd_end), VALUE beg = rb_eval(self, node->nd_beg);
nd_type(node) == NODE_DOT3); VALUE end = rb_eval(self, node->nd_end);
result = rb_range_new(beg, end, nd_type(node) == NODE_DOT3);
}
break; break;
case NODE_FLIP2: /* like AWK */ case NODE_FLIP2: /* like AWK */

2
file.c
View File

@ -1997,7 +1997,7 @@ sys_fail2(s1, s2)
len = RSTRING(s1)->len + RSTRING(s2)->len + 5; len = RSTRING(s1)->len + RSTRING(s2)->len + 5;
buf = ALLOCA_N(char, len); buf = ALLOCA_N(char, len);
snprintf(buf, len, "%s or %s", RSTRING(s1)->ptr, RSTRING(s2)->ptr); snprintf(buf, len, "(%s, %s)", RSTRING(s1)->ptr, RSTRING(s2)->ptr);
rb_sys_fail(buf); rb_sys_fail(buf);
} }

View File

@ -49,6 +49,14 @@ class Delegator
end end
alias initialize_methods initialize alias initialize_methods initialize
def method_missing(m, *args)
target = self.__getobj__
unless target.respond_to?(m)
super(m, *args)
end
target.__send__(m, *args)
end
def __getobj__ def __getobj__
raise NotImplementedError, "need to define `__getobj__'" raise NotImplementedError, "need to define `__getobj__'"
end end

View File

@ -101,7 +101,6 @@ class Set
if enum.class == self.class if enum.class == self.class
@hash.replace(enum.instance_eval { @hash }) @hash.replace(enum.instance_eval { @hash })
else else
enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
clear clear
enum.each { |o| add(o) } enum.each { |o| add(o) }
end end
@ -254,7 +253,6 @@ class Set
if enum.is_a?(Set) if enum.is_a?(Set)
@hash.update(enum.instance_eval { @hash }) @hash.update(enum.instance_eval { @hash })
else else
enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
enum.each { |o| add(o) } enum.each { |o| add(o) }
end end
@ -264,7 +262,6 @@ class Set
# Deletes every element that appears in the given enumerable object # Deletes every element that appears in the given enumerable object
# and returns self. # and returns self.
def subtract(enum) def subtract(enum)
enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
enum.each { |o| delete(o) } enum.each { |o| delete(o) }
self self
end end
@ -272,7 +269,6 @@ class Set
# Returns a new set built by merging the set and the elements of the # Returns a new set built by merging the set and the elements of the
# given enumerable object. # given enumerable object.
def |(enum) def |(enum)
enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
dup.merge(enum) dup.merge(enum)
end end
alias + | ## alias + | ##
@ -281,7 +277,6 @@ class Set
# Returns a new set built by duplicating the set, removing every # Returns a new set built by duplicating the set, removing every
# element that appears in the given enumerable object. # element that appears in the given enumerable object.
def -(enum) def -(enum)
enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
dup.subtract(enum) dup.subtract(enum)
end end
alias difference - ## alias difference - ##
@ -289,7 +284,6 @@ class Set
# Returns a new array containing elements common to the set and the # Returns a new array containing elements common to the set and the
# given enumerable object. # given enumerable object.
def &(enum) def &(enum)
enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
n = self.class.new n = self.class.new
enum.each { |o| n.add(o) if include?(o) } enum.each { |o| n.add(o) if include?(o) }
n n
@ -300,7 +294,6 @@ class Set
# and the given enumerable object. (set ^ enum) is equivalent to # and the given enumerable object. (set ^ enum) is equivalent to
# ((set | enum) - (set & enum)). # ((set | enum) - (set & enum)).
def ^(enum) def ^(enum)
enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
n = dup n = dup
enum.each { |o| if n.include?(o) then n.delete(o) else n.add(o) end } enum.each { |o| if n.include?(o) then n.delete(o) else n.add(o) end }
n n
@ -519,6 +512,7 @@ end
module Enumerable module Enumerable
# Makes a set from the enumerable object with given arguments. # Makes a set from the enumerable object with given arguments.
# Needs to +require "set"+ to use this method.
def to_set(klass = Set, *args, &block) def to_set(klass = Set, *args, &block)
klass.new(self, *args, &block) klass.new(self, *args, &block)
end end
@ -573,7 +567,6 @@ end
# end # end
# #
# def replace(enum) # def replace(enum)
# enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
# clear # clear
# enum.each { |o| add(o) } # enum.each { |o| add(o) }
# #
@ -581,7 +574,6 @@ end
# end # end
# #
# def merge(enum) # def merge(enum)
# enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
# enum.each { |o| add(o) } # enum.each { |o| add(o) }
# #
# self # self

16
parse.y
View File

@ -56,6 +56,7 @@ int ruby_sourceline; /* current line no. */
enum lex_state_e { enum lex_state_e {
EXPR_BEG, /* ignore newline, +/- is a sign. */ EXPR_BEG, /* ignore newline, +/- is a sign. */
EXPR_END, /* newline significant, +/- is a operator. */ EXPR_END, /* newline significant, +/- is a operator. */
EXPR_END2, /* newline significant, +/- is a operator. */
EXPR_ARG, /* newline significant, +/- is a operator. */ EXPR_ARG, /* newline significant, +/- is a operator. */
EXPR_CMDARG, /* newline significant, +/- is a operator. */ EXPR_CMDARG, /* newline significant, +/- is a operator. */
EXPR_ENDARG, /* newline significant, +/- is a operator. */ EXPR_ENDARG, /* newline significant, +/- is a operator. */
@ -5725,6 +5726,7 @@ parser_yylex(parser)
c = nextc(); c = nextc();
if (c == '<' && if (c == '<' &&
lex_state != EXPR_END && lex_state != EXPR_END &&
lex_state != EXPR_END2 &&
lex_state != EXPR_DOT && lex_state != EXPR_DOT &&
lex_state != EXPR_ENDARG && lex_state != EXPR_ENDARG &&
lex_state != EXPR_CLASS && lex_state != EXPR_CLASS &&
@ -5803,7 +5805,9 @@ parser_yylex(parser)
return tSTRING_BEG; return tSTRING_BEG;
case '?': case '?':
if (lex_state == EXPR_END || lex_state == EXPR_ENDARG) { if (lex_state == EXPR_END ||
lex_state == EXPR_END2 ||
lex_state == EXPR_ENDARG) {
lex_state = EXPR_VALUE; lex_state = EXPR_VALUE;
return '?'; return '?';
} }
@ -6232,7 +6236,8 @@ parser_yylex(parser)
lex_state = EXPR_DOT; lex_state = EXPR_DOT;
return tCOLON2; return tCOLON2;
} }
if (lex_state == EXPR_END || lex_state == EXPR_ENDARG || ISSPACE(c)) { if (lex_state == EXPR_END || lex_state == EXPR_END2 ||
lex_state == EXPR_ENDARG || ISSPACE(c)) {
pushback(c); pushback(c);
lex_state = EXPR_BEG; lex_state = EXPR_BEG;
return ':'; return ':';
@ -6293,11 +6298,10 @@ parser_yylex(parser)
return '^'; return '^';
case ';': case ';':
if ((c = nextc()) == ';') { if (lex_state != EXPR_END2 && peek(';')) {
lex_state = EXPR_END; lex_state = EXPR_END2;
return kEND; return kEND;
} }
pushback(c);
lex_state = EXPR_BEG; lex_state = EXPR_BEG;
command_start = Qtrue; command_start = Qtrue;
return ';'; return ';';
@ -6363,7 +6367,7 @@ parser_yylex(parser)
return c; return c;
case '{': case '{':
if (IS_ARG() || lex_state == EXPR_END) if (IS_ARG() || lex_state == EXPR_END || lex_state == EXPR_END2)
c = '{'; /* block (primary) */ c = '{'; /* block (primary) */
else if (lex_state == EXPR_ENDARG) else if (lex_state == EXPR_ENDARG)
c = tLBRACE_ARG; /* block (expr) */ c = tLBRACE_ARG; /* block (expr) */

View File

@ -851,7 +851,7 @@ detach_process_watcher(pid_p)
for (;;) { for (;;) {
cpid = rb_waitpid(*pid_p, &status, WNOHANG); cpid = rb_waitpid(*pid_p, &status, WNOHANG);
if (cpid == -1) return rb_last_status; if (cpid != 0) return rb_last_status;
rb_thread_sleep(1); rb_thread_sleep(1);
} }
} }

View File

@ -314,11 +314,11 @@ range_step(argc, argv, range)
if (unit < 0) { if (unit < 0) {
rb_raise(rb_eArgError, "step can't be negative"); rb_raise(rb_eArgError, "step can't be negative");
} }
if (unit == 0) rb_raise(rb_eArgError, "step can't be 0");
if (FIXNUM_P(b) && FIXNUM_P(e)) { /* fixnums are special */ if (FIXNUM_P(b) && FIXNUM_P(e)) { /* fixnums are special */
long end = FIX2LONG(e); long end = FIX2LONG(e);
long i; long i;
if (unit == 0) rb_raise(rb_eArgError, "step can't be 0");
if (!EXCL(range)) end += 1; if (!EXCL(range)) end += 1;
for (i=FIX2LONG(b); i<end; i+=unit) { for (i=FIX2LONG(b); i<end; i+=unit) {
rb_yield(LONG2NUM(i)); rb_yield(LONG2NUM(i));
@ -332,7 +332,6 @@ range_step(argc, argv, range)
long iter[2]; long iter[2];
b = tmp; b = tmp;
if (unit == 0) rb_raise(rb_eArgError, "step can't be 0");
args[0] = b; args[1] = e; args[2] = range; args[0] = b; args[1] = e; args[2] = range;
iter[0] = 1; iter[1] = unit; iter[0] = 1; iter[1] = unit;
rb_iterate((VALUE(*)_((VALUE)))str_step, (VALUE)args, step_i, rb_iterate((VALUE(*)_((VALUE)))str_step, (VALUE)args, step_i,
@ -350,12 +349,10 @@ range_step(argc, argv, range)
else { else {
long args[2]; long args[2];
if (unit == 0) rb_raise(rb_eArgError, "step can't be 0");
if (!rb_respond_to(b, id_succ)) { if (!rb_respond_to(b, id_succ)) {
rb_raise(rb_eTypeError, "can't iterate from %s", rb_raise(rb_eTypeError, "can't iterate from %s",
rb_obj_classname(b)); rb_obj_classname(b));
} }
args[0] = 1; args[0] = 1;
args[1] = unit; args[1] = unit;
range_each_func(range, step_i, b, e, args); range_each_func(range, step_i, b, e, args);

View File

@ -593,6 +593,14 @@ sigexit(sig)
} }
#endif #endif
if (trap_list[sig].cmd == 0 && ATOMIC_TEST(rb_trap_immediate)) {
IN_MAIN_CONTEXT(signal_exec, sig);
ATOMIC_SET(rb_trap_immediate, 1);
}
else {
ATOMIC_INC(rb_trap_pending);
ATOMIC_INC(trap_pending_list[sig]);
}
rb_thread_signal_exit(); rb_thread_signal_exit();
} }
@ -601,39 +609,43 @@ trap(arg)
struct trap_arg *arg; struct trap_arg *arg;
{ {
sighandler_t func, oldfunc; sighandler_t func, oldfunc;
VALUE command, oldcmd; VALUE command, tmp, oldcmd;
int sig = -1; int sig = -1;
char *s; char *s;
func = sighandler; func = sighandler;
command = arg->cmd; if (NIL_P(arg->cmd)) {
if (NIL_P(command)) {
func = SIG_IGN; func = SIG_IGN;
} }
else if (TYPE(command) == T_STRING) { else {
SafeStringValue(command); /* taint check */ command = rb_check_string_type(arg->cmd);
if (RSTRING(command)->len == 0) { if (!NIL_P(command)) {
func = SIG_IGN; SafeStringValue(command); /* taint check */
} switch (RSTRING(command)->len) {
else if (RSTRING(command)->len == 7) { case 0:
if (strncmp(RSTRING(command)->ptr, "SIG_IGN", 7) == 0) {
func = SIG_IGN; func = SIG_IGN;
} break;
else if (strncmp(RSTRING(command)->ptr, "SIG_DFL", 7) == 0) { case 7:
func = SIG_DFL; if (strncmp(RSTRING(command)->ptr, "SIG_IGN", 7) == 0) {
} func = SIG_IGN;
else if (strncmp(RSTRING(command)->ptr, "DEFAULT", 7) == 0) { }
func = SIG_DFL; else if (strncmp(RSTRING(command)->ptr, "SIG_DFL", 7) == 0) {
} func = SIG_DFL;
} }
else if (RSTRING(command)->len == 6) { else if (strncmp(RSTRING(command)->ptr, "DEFAULT", 7) == 0) {
if (strncmp(RSTRING(command)->ptr, "IGNORE", 6) == 0) { func = SIG_DFL;
func = SIG_IGN; }
} break;
} case 6:
else if (RSTRING(command)->len == 4) { if (strncmp(RSTRING(command)->ptr, "IGNORE", 6) == 0) {
if (strncmp(RSTRING(command)->ptr, "EXIT", 4) == 0) { func = SIG_IGN;
func = sigexit; }
break;
case 4:
if (strncmp(RSTRING(command)->ptr, "EXIT", 4) == 0) {
func = sigexit;
}
break;
} }
} }
} }