diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-06-27 05:41:28 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-06-27 05:41:28 +0000 |
| commit | 11e5165613a74fca9c761906303c245fb237f0d9 (patch) | |
| tree | a0800f45d5e8c251df0f4d39c2e4c0894f6c5449 | |
| parent | 807ad614530d6e3c1470ad7abb3d05a71516d862 (diff) | |
| download | ruby-11e5165613a74fca9c761906303c245fb237f0d9.tar.gz ruby-11e5165613a74fca9c761906303c245fb237f0d9.tar.xz ruby-11e5165613a74fca9c761906303c245fb237f0d9.zip | |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@4010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | string.c | 3 |
2 files changed, 7 insertions, 1 deletions
@@ -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> * io.c (io_fflush): need to check if closed after thread switch. @@ -2581,6 +2581,7 @@ rb_str_split_m(argc, argv, str) else { end = beg+1; skip = 0; + if (!NIL_P(limit) && lim <= i) break; } } else { @@ -2588,7 +2589,7 @@ rb_str_split_m(argc, argv, str) rb_ary_push(result, rb_str_substr(str, beg, end-beg)); skip = 1; beg = end + 1; - if (!NIL_P(limit) && lim <= ++i) break; + if (!NIL_P(limit)) ++i; } else { end++; |
