From: Yukihiro Matsumoto Date: 2005-09-14T08:12:35+09:00 Subject: Re: Question on StringValuePtr, rb_str_dup Hi, In message "Re: Question on StringValuePtr, rb_str_dup" on Wed, 14 Sep 2005 06:38:44 +0900, "Berger, Daniel" writes: |I'm having a hard time preserving a string. Essentially, what's |happening is that even though I'm dup'ing the original string, after I |pass it a C function that modifies the receiver, both the original |string *and* the dup appear to be affected. Because plain duplication shares internal memory region. You have to call rb_str_modify() before modifying a string. matz.