ruby-changes:3400
From: ko1@a...
Date: 5 Jan 2008 16:52:02 +0900
Subject: [ruby-changes:3400] nobu - Ruby:r14893 (trunk): * string.c (rb_str_resize): copy if old data is not empty
nobu 2008-01-05 16:50:50 +0900 (Sat, 05 Jan 2008) New Revision: 14893 Modified files: trunk/ChangeLog trunk/string.c Log: * string.c (rb_str_resize): copy if old data is not empty [ruby-core:14785] http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/string.c?r1=14893&r2=14892&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=14893&r2=14892&diff_format=u Index: ChangeLog =================================================================== --- ChangeLog (revision 14892) +++ ChangeLog (revision 14893) @@ -1,6 +1,6 @@ -Sat Jan 5 14:45:38 2008 Nobuyoshi Nakada <nobu@r...> +Sat Jan 5 16:50:48 2008 Nobuyoshi Nakada <nobu@r...> - * string.c (rb_str_resize): copy at old length but not new length. + * string.c (rb_str_resize): copy if old data is not empty [ruby-core:14785] Sat Jan 5 13:04:24 2008 Nobuyoshi Nakada <nobu@r...> Index: string.c =================================================================== --- string.c (revision 14892) +++ string.c (revision 14893) @@ -948,7 +948,7 @@ else if (len <= RSTRING_EMBED_LEN_MAX) { char *ptr = RSTRING(str)->as.heap.ptr; STR_SET_EMBED(str); - if (slen > 0) MEMCPY(RSTRING(str)->as.ary, ptr, char, slen); + if (slen > 0) MEMCPY(RSTRING(str)->as.ary, ptr, char, len); RSTRING(str)->as.ary[len] = '\0'; STR_SET_EMBED_LEN(str, len); xfree(ptr); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml