[#1026] Is this a bug? — Dave Thomas <Dave@...>

18 messages 2000/01/03

[#1084] Infinite loop — Dave Thomas <Dave@...>

17 messages 2000/01/11

[#1104] The value of while... — Dave Thomas <Dave@...>

24 messages 2000/01/11

[ruby-talk:01139] Bug in String

From: Dave Thomas <Dave@...>
Date: 2000-01-13 23:57:59 UTC
List: ruby-talk #1139
     ruby> a = 'abcdef'
     "abcdef"
     ruby> a[1] = a
     "aaaaaaacdef"
     ruby> 

I think it's because str_replace uses memcpy on an overlapping string 
(two copies of RSTRING(a)->ptr in this case). memcpy is specified not
to work on overlapping strings.


I could produce a patch if you want.


Regards


Dave

In This Thread

Prev Next