[#1816] Ruby 1.5.3 under Tru64 (Alpha)? — Clemens Hintze <clemens.hintze@...>

Hi all,

17 messages 2000/03/14

[#1989] English Ruby/Gtk Tutorial? — schneik@...

18 messages 2000/03/17

[#2241] setter() for local variables — ts <decoux@...>

18 messages 2000/03/29

[ruby-talk:01828] Re: Very strange problem in chomp and/or sub, or with me

From: matz@... (Yukihiro Matsumoto)
Date: 2000-03-15 04:43:14 UTC
List: ruby-talk #1828
In message "[ruby-talk:01825] Very strange problem in chomp and/or sub, or with me"
    on 00/03/14, Dave Thomas <Dave@thomases.com> writes:

|FE: [10, 15, 22, 120]-> [10,\ 15,\ 22,\ 120]^@
|18: '[0.8333333333, 1.25, 1.833333333, 10.0]'
|FE: [0.8333333333, 1.25, 1.833333333, 10.0]->
|  [0.8333333333,\ 1.25,\ 1.833333333,\ 10.0]^@
|
|Note the NULL character added to the end of the result.

|Am I doing something stupid here?

No, it's a bug.  It'll be solved by the following patch, which I
already sent to Dave.  But I think the problem reported in
[ruby-talk:01826] is another story.

--- string.c	2000/03/13 07:18:39	1.24
+++ string.c	2000/03/15 04:13:04
@@ -2364,2 +2356,3 @@
 	if (len < RSTRING(str)->len) {
+	    rb_str_modify(str);
 	    RSTRING(str)->len = len;
@@ -2376,2 +2369,3 @@
 	 memcmp(RSTRING(rs)->ptr, p+len-rslen, rslen) == 0)) {
+	rb_str_modify(str);
 	RSTRING(str)->len -= rslen;



In This Thread

Prev Next