diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-24 15:41:39 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-24 15:41:39 +0000 |
commit | 400ded9338961ce39b3cd9cb58f03277e0a37f2d (patch) | |
tree | f93502bd3522eb607fba9614da01d9e0b3e44aa4 /class.c | |
parent | 02316f11d5cabf4a5cbaaa1f9f48711d5c61b7dd (diff) |
* 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
Diffstat (limited to 'class.c')
-rw-r--r-- | class.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -934,6 +934,11 @@ rb_scan_args(int argc, const VALUE *argv, const char *fmt, ...) if (ISDIGIT(*p)) { n_opt = *p - '0'; p++; + if (ISDIGIT(*p)) { + n_trail = *p - '0'; + p++; + goto block_arg; + } } } if (*p == '*') { @@ -944,6 +949,7 @@ rb_scan_args(int argc, const VALUE *argv, const char *fmt, ...) p++; } } + block_arg: if (*p == '&') { f_block = 1; p++; |