1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* marshal.c (w_object): module inclusion using extend() should

also be detected.

* eval.c (rb_eval_cmd): cbase should not be NULL; it should be
  either ruby_wrapper or Object.

* enum.c (enum_each_with_index): should return self.

* process.c (proc_setpgrp): should return value for non-void function.

* process.c (proc_getpgid): should raise exception if getpgid() return -1.

* string.c (rb_str_ljust): should return a duplicated string.

* string.c (rb_str_rjust): ditto.

* string.c (rb_str_center): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2002-03-11 08:02:04 +00:00
parent 81930da895
commit 86c6af5873
10 changed files with 65 additions and 28 deletions

View file

@ -217,26 +217,33 @@ rb_f_kill(argc, argv)
goto str_signal;
case T_STRING:
{
s = RSTRING(argv[0])->ptr;
if (s[0] == '-') {
negative++;
s++;
}
str_signal:
if (strncmp("SIG", s, 3) == 0)
s += 3;
if((sig = signm2signo(s)) == 0)
rb_raise(rb_eArgError, "unrecognized signal name `%s'", s);
if (negative)
sig = -sig;
s = RSTRING(argv[0])->ptr;
if (s[0] == '-') {
negative++;
s++;
}
str_signal:
if (strncmp("SIG", s, 3) == 0)
s += 3;
if((sig = signm2signo(s)) == 0)
rb_raise(rb_eArgError, "unsupported name `SIG%s'", s);
if (negative)
sig = -sig;
break;
default:
rb_raise(rb_eArgError, "bad signal type %s",
rb_class2name(CLASS_OF(argv[0])));
{
VALUE str;
str = rb_check_convert_type(argv[0], T_STRING, "String", "to_str");
if (!NIL_P(str)) {
s = RSTRING(str)->ptr;
goto str_signal;
}
rb_raise(rb_eArgError, "bad signal type %s",
rb_class2name(CLASS_OF(argv[0])));
}
break;
}