From adc0898538b5656a0aae9a4c604876e398db539c Mon Sep 17 00:00:00 2001 From: yui-knk Date: Wed, 23 Dec 2015 03:02:07 +0000 Subject: * string.c: Fix document. Default value of the first argument of `String#split` is not `$;` but `nil`. When `nil` is passed as first argument, `$;` is used. [ci skip] [Bug #11729] [ruby-dev:49378] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ string.c | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9e91e3244b..e7b24143e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Wed Dec 23 11:58:52 2015 Yuichiro Kaneko + + * string.c: Fix document. Default value of the first + argument of `String#split` is not `$;` but `nil`. + When `nil` is passed as first argument, `$;` is used. + [ci skip] [Bug #11729] [ruby-dev:49378] + Wed Dec 23 07:15:17 2015 Eric Wong * ext/socket/init.c (rsock_init_sock): reject reserved FDs diff --git a/string.c b/string.c index 4f9fe51f9f..f4519ea425 100644 --- a/string.c +++ b/string.c @@ -6701,7 +6701,7 @@ static const char isspacetable[256] = { /* * call-seq: - * str.split(pattern=$;, [limit]) -> anArray + * str.split(pattern=nil, [limit]) -> anArray * * Divides str into substrings based on a delimiter, returning an array * of these substrings. @@ -6716,8 +6716,8 @@ static const char isspacetable[256] = { * str is split into individual characters. If pattern contains * groups, the respective matches will be returned in the array as well. * - * If pattern is omitted, the value of $; is used. If - * $; is nil (which is the default), str is + * If pattern is nil, the value of $; is used. + * If $; is nil (which is the default), str is * split on whitespace as if ` ' were specified. * * If the limit parameter is omitted, trailing null fields are -- cgit v1.2.3