[#2023] Class Method の index — (Dezawa Shin-ichiro) <dezawa@...>

出沢です

13 messages 1997/02/02

[#2158] [Req] pack/unpack — keiju@... (Keiju ISHITSUKA)

けいじゅ@SHLジャパンです.

14 messages 1997/02/18
[#2166] Re: [Req] pack/unpack — matz@... (Yukihiro Matsumoto) 1997/02/18

まつもと ゆきひろです.

[#2277] ruby 1.0-970228 available — matz@... (Yukihiro Matsumoto)

まつもと ゆきひろです.

16 messages 1997/02/28

[ruby-list:2190] Re: [BUG] split(" ", limit)

From: matz@... (Yukihiro Matsumoto)
Date: 1997-02-18 17:53:11 UTC
List: ruby-list #2190
まつもと ゆきひろです

In message "[ruby-list:2171] Re: [BUG] split(" ", limit)"
    on 97/02/18, WATANABE Hirofumi <watanabe@ase.ptg.sony.co.jp> writes:
|わたなべです.

|これでどうかな? の 2 回目.

惜しい.でも,とても参考になりました.
どうも以下のパッチが原さんの(perlの)仕様を満たすようです

--- string.c.orig	Wed Feb 19 01:32:28 1997
+++ string.c	Wed Feb 19 02:31:22 1997
@@ -1631,2 +1631,4 @@
 	lim = NUM2INT(limit);
+	if (lim == 0) limit = Qnil;
+	else if (lim == 1) return ary_new3(1, str);
 	i = 1;
@@ -1681,4 +1683,4 @@
 		    if (isspace(*ptr)) {
-			ary_push(result, str_substr(str, beg, end-beg));
 			if (!NIL_P(limit) && lim <= ++i) break;
+			ary_push(result, str_substr(str, beg, end-beg));
 			skip = 1;
@@ -1695,4 +1697,4 @@
 		if (*ptr == char_sep) {
-		    ary_push(result, str_substr(str, beg, end-beg));
 		    if (!NIL_P(limit) && lim <= ++i) break;
+		    ary_push(result, str_substr(str, beg, end-beg));
 		    beg = end + 1;

In This Thread