1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* string.c (rb_str_split_m): remove white spaces on the head of

the last element, when limit is specified.  [ruby-talk:74506]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2003-06-27 05:41:28 +00:00
parent f64d6232ab
commit 057dcc0495
2 changed files with 7 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Fri Jun 27 14:41:22 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* string.c (rb_str_split_m): remove white spaces on the head of
the last element, when limit is specified. [ruby-talk:74506]
Fri Jun 27 03:24:54 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net> Fri Jun 27 03:24:54 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* io.c (io_fflush): need to check if closed after thread switch. * io.c (io_fflush): need to check if closed after thread switch.

View file

@ -2581,6 +2581,7 @@ rb_str_split_m(argc, argv, str)
else { else {
end = beg+1; end = beg+1;
skip = 0; skip = 0;
if (!NIL_P(limit) && lim <= i) break;
} }
} }
else { else {
@ -2588,7 +2589,7 @@ rb_str_split_m(argc, argv, str)
rb_ary_push(result, rb_str_substr(str, beg, end-beg)); rb_ary_push(result, rb_str_substr(str, beg, end-beg));
skip = 1; skip = 1;
beg = end + 1; beg = end + 1;
if (!NIL_P(limit) && lim <= ++i) break; if (!NIL_P(limit)) ++i;
} }
else { else {
end++; end++;