mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/socket/socket.c (sock_s_unpack_sockaddr_in): remove struct
size check. getnameinfo(3) can handle. [ruby-dev:19967] * io.c (io_read): do not call rb_sys_fail() when required data length is zero. (ruby-bugs-ja PR#420) * eval.c (umethod_proc): should raise TypeError, instead of returning error causing Proc. Following the principle of "fail early". [ruby-core:00927] * pack.c (pack_pack): small but serious typo. * eval.c (backtrace): skip internal allocator frame. (ruby-bugs-ja PR#416) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e393f0ad16
commit
e11f6de3c5
6 changed files with 31 additions and 15 deletions
23
ChangeLog
23
ChangeLog
|
@ -1,7 +1,30 @@
|
|||
Mon Apr 7 15:49:09 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* ext/socket/socket.c (sock_s_unpack_sockaddr_in): remove struct
|
||||
size check. getnameinfo(3) can handle. [ruby-dev:19967]
|
||||
|
||||
Mon Apr 7 01:33:31 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* io.c (io_read): do not call rb_sys_fail() when required data
|
||||
length is zero. (ruby-bugs-ja PR#420)
|
||||
|
||||
* eval.c (umethod_proc): should raise TypeError, instead of
|
||||
returning error causing Proc. Following the principle of "fail
|
||||
early". [ruby-core:00927]
|
||||
|
||||
Sun Apr 6 00:35:37 2003 Tanaka Akira <akr@m17n.org>
|
||||
|
||||
* sample/exyacc.rb: use Regexp in gsub!.
|
||||
|
||||
Sat Apr 5 23:41:28 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* pack.c (pack_pack): small but serious typo.
|
||||
|
||||
Sat Apr 5 01:41:28 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* eval.c (backtrace): skip internal allocator frame.
|
||||
(ruby-bugs-ja PR#416)
|
||||
|
||||
Fri Apr 4 10:53:22 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* eval.c (assign): should prepare mrhs by svalue_to_mrhs().
|
||||
|
|
13
eval.c
13
eval.c
|
@ -5087,6 +5087,9 @@ backtrace(lev)
|
|||
NODE *n;
|
||||
|
||||
ary = rb_ary_new();
|
||||
if (frame->last_func == ID_ALLOCATOR) {
|
||||
frame = frame->prev;
|
||||
}
|
||||
if (lev < 0) {
|
||||
ruby_set_current_source();
|
||||
if (frame->last_func) {
|
||||
|
@ -7317,13 +7320,6 @@ bmcall(args, method)
|
|||
return method_call(RARRAY(a)->len, RARRAY(a)->ptr, method);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
umcall(args, method)
|
||||
VALUE args, method;
|
||||
{
|
||||
return method_call(0, 0, method);
|
||||
}
|
||||
|
||||
VALUE
|
||||
rb_proc_new(func, val)
|
||||
VALUE (*func)(ANYARGS); /* VALUE yieldarg[, VALUE procarg] */
|
||||
|
@ -7343,7 +7339,8 @@ static VALUE
|
|||
umethod_proc(method)
|
||||
VALUE method;
|
||||
{
|
||||
return rb_iterate((VALUE(*)_((VALUE)))mproc, method, umcall, method);
|
||||
rb_raise(rb_eTypeError, "unbound method cannot be executed; bind first");
|
||||
return Qnil; /* not reached */
|
||||
}
|
||||
|
||||
static VALUE
|
||||
|
|
|
@ -2328,10 +2328,6 @@ sock_s_unpack_sockaddr_in(self, addr)
|
|||
VALUE host;
|
||||
|
||||
sockaddr = (struct sockaddr_in*)StringValuePtr(addr);
|
||||
if (RSTRING(addr)->len != sizeof(struct sockaddr_in)) {
|
||||
rb_raise(rb_eTypeError, "sockaddr_in size differs - %ld required; %d given",
|
||||
RSTRING(addr)->len, sizeof(struct sockaddr_in));
|
||||
}
|
||||
host = mkipaddr((struct sockaddr*)sockaddr);
|
||||
OBJ_INFECT(host, addr);
|
||||
return rb_assoc_new(INT2NUM(ntohs(sockaddr->sin_port)), host);
|
||||
|
|
2
io.c
2
io.c
|
@ -836,7 +836,7 @@ io_read(argc, argv, io)
|
|||
if (n == 0) {
|
||||
rb_str_resize(str,0);
|
||||
if (feof(fptr->f)) return Qnil;
|
||||
rb_sys_fail(fptr->path);
|
||||
if (len > 0) rb_sys_fail(fptr->path);
|
||||
}
|
||||
RSTRING(str)->len = n;
|
||||
RSTRING(str)->ptr[n] = '\0';
|
||||
|
|
2
object.c
2
object.c
|
@ -740,7 +740,7 @@ rb_class_allocate_instance(klass)
|
|||
if (FL_TEST(klass, FL_SINGLETON)) {
|
||||
rb_raise(rb_eTypeError, "can't create instance of virtual class");
|
||||
}
|
||||
{
|
||||
else {
|
||||
NEWOBJ(obj, struct RObject);
|
||||
OBJSETUP(obj, klass, T_OBJECT);
|
||||
return (VALUE)obj;
|
||||
|
|
2
pack.c
2
pack.c
|
@ -550,7 +550,7 @@ pack_pack(ary, fmt)
|
|||
char c = byte & 0xff;
|
||||
rb_str_buf_cat(res, &c, 1);
|
||||
}
|
||||
len = 1;
|
||||
len = j;
|
||||
goto grow;
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue