[#20392] [BigDecimal] proposal to change specification — "Tadashi Saito" <shiba@...2.accsnet.ne.jp>

斎藤と申します。

25 messages 2003/06/20
[#20407] Re: [BigDecimal] proposal to change specification — "Shigeo Kobayashi" <shigeo@...> 2003/06/22

小林です。

[#20447] [BigDecimal] renaming proposal — "Tadashi Saito" <shiba@...2.accsnet.ne.jp>

斎藤です。

47 messages 2003/06/24
[#20621] Re: [BigDecimal] renaming proposal — "Shigeo Kobayashi" <shigeo@...> 2003/07/11

小林@MAILチェック中です。

[#20628] Re: [BigDecimal] renaming proposal — "Shigeo Kobayashi" <shigeo@...> 2003/07/11

小林です。

[ruby-dev:20468] Re: In 1.8.0 nil.to_s is not the same as ""

From: nobu.nakada@...
Date: 2003-06-26 18:24:02 UTC
List: ruby-dev #20468
なかだです。

At Mon, 23 Jun 2003 17:27:47 +0900,
Yukihiro Matsumoto wrote:
> |* string.c (rb_str_rindex_m): Fixnum 0 matched end of string.

これの修正が間違ってました。

  $ ruby -e 'p "a".rindex(?a, -1)'
  nil


Index: string.c
===================================================================
RCS file: /cvs/ruby/src/ruby/string.c,v
retrieving revision 1.160
diff -u -2 -p -r1.160 string.c
--- string.c	23 Jun 2003 08:45:59 -0000	1.160
+++ string.c	26 Jun 2003 18:03:32 -0000
@@ -1011,6 +1011,11 @@ rb_str_rindex_m(argc, argv, str)
 	  char *pbeg = RSTRING(str)->ptr;
 
-	  while (pbeg <= --p) {
+	  if (pos == RSTRING(str)->len) {
+	      if (pos == 0) return Qnil;
+	      --p;
+	  }
+	  while (pbeg <= p) {
 	      if (*p == c) return LONG2NUM(p - RSTRING(str)->ptr);
+	      p--;
 	  }
 	  return Qnil;


-- 
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
    中田 伸悦

In This Thread

Prev Next