summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-27 02:01:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-27 02:01:24 +0000
commit9e1da70e1478583dfaeac97652599fff1c56f493 (patch)
tree99b70be2522ba5ab31383a28e5fffee99a7b4742 /string.c
parent55180306ddab6b92c8af08f76e3c6287823e1cce (diff)
* intern.h, string.c (rb_str_set_len): added for upgrading path from
1.8 to 1.9. [ruby-dev:32807] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@14727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/string.c b/string.c
index 55a888b2d1..602e272763 100644
--- a/string.c
+++ b/string.c
@@ -671,6 +671,13 @@ rb_str_unlocktmp(str)
return str;
}
+void
+rb_str_set_len(VALUE str, long len)
+{
+ RSTRING(str)->len = len;
+ RSTRING(str)->ptr[len] = '\0';
+}
+
VALUE
rb_str_resize(str, len)
VALUE str;