mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* class.c (rb_scan_args): Allow specifying the number of trailing
mandatory arguments right after the number of optional arguments only if the number of leading mandatory arguments is not omitted. * ext/socket/tcpserver.c (tcp_svr_init): Make use of it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
02316f11d5
commit
400ded9338
5 changed files with 23 additions and 9 deletions
|
@ -26,12 +26,10 @@
|
|||
static VALUE
|
||||
tcp_svr_init(int argc, VALUE *argv, VALUE sock)
|
||||
{
|
||||
VALUE arg1, arg2;
|
||||
VALUE hostname, port;
|
||||
|
||||
if (rb_scan_args(argc, argv, "11", &arg1, &arg2) == 2)
|
||||
return init_inetsock(sock, arg1, arg2, Qnil, Qnil, INET_SERVER);
|
||||
else
|
||||
return init_inetsock(sock, Qnil, arg1, Qnil, Qnil, INET_SERVER);
|
||||
rb_scan_args(argc, argv, "011", &hostname, &port);
|
||||
return init_inetsock(sock, hostname, port, Qnil, Qnil, INET_SERVER);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue