From: matz@... (Yukihiro Matsumoto) Date: 2000-01-14T12:24:23+09:00 Subject: [ruby-talk:01140] Re: Bug in String Hi, In message "[ruby-talk:01139] Bug in String" on 00/01/13, Dave Thomas writes: | ruby> a = 'abcdef' | ruby> a[1] = a | "aaaaaaacdef" |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. Changing memcpy to memmove in rb_str_replace worked well. Thank you for finding a bug. matz.