From 5f13d888cf0aece7c1bb13b72773f66a4b9cebff Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 4 Aug 2010 11:08:28 +0000 Subject: * string.c (rb_str_resize): reverted r28851. rb_str_resize cannot work before the length is set. [ruby-core:31615] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/-test-/bug-3652/bug.c | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 ext/-test-/bug-3652/bug.c (limited to 'ext/-test-/bug-3652/bug.c') diff --git a/ext/-test-/bug-3652/bug.c b/ext/-test-/bug-3652/bug.c deleted file mode 100644 index 290ac2ddee..0000000000 --- a/ext/-test-/bug-3652/bug.c +++ /dev/null @@ -1,16 +0,0 @@ -#include - -static VALUE -bug_str_resize(VALUE self, VALUE init, VALUE repl) -{ - long initlen = NUM2LONG(init); - VALUE s = rb_str_buf_new(initlen); - return rb_str_resize(s, strlcpy(RSTRING_PTR(s), StringValueCStr(repl), (size_t)initlen)); -} - -void -Init_bug(void) -{ - VALUE mBug = rb_define_module("Bug"); - rb_define_module_function(mBug, "str_resize", bug_str_resize, 2); -} -- cgit v1.2.3