summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-24 15:41:39 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-24 15:41:39 +0000
commit400ded9338961ce39b3cd9cb58f03277e0a37f2d (patch)
treef93502bd3522eb607fba9614da01d9e0b3e44aa4 /class.c
parent02316f11d5cabf4a5cbaaa1f9f48711d5c61b7dd (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.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/class.c b/class.c
index 7ba47e4e26..a75a789ce9 100644
--- a/class.c
+++ b/class.c
@@ -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++;