summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-29 06:13:52 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-29 06:13:52 +0000
commitf6348ca0eac1eb3fd89f1bce233204b096de3e98 (patch)
treecb8bf5f5497b32eea8882dc159a4b8b41a85ecea /string.c
parentc56fa330b24863f5e946caf7846a1a8b44674e48 (diff)
* object.c (convert_type): [ruby-core:03845]
* eval.c (rb_funcall_rescue): new function. * object.c (rb_Array): avoid using rb_respond_to(). * object.c (rb_Integer): ditto. * eval.c (get_backtrace): no conversion for nil. * parse.y (reduce_nodes): empty body should return nil. * lib/cgi/session.rb (CGI::Session::initialize): [ruby-core:03832] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/string.c b/string.c
index 7416561e28..aac1f2bf6c 100644
--- a/string.c
+++ b/string.c
@@ -1386,7 +1386,7 @@ rb_str_succ(orig)
int c = -1;
long n = 0;
- str = rb_str_new5(orig,RSTRING(orig)->ptr, RSTRING(orig)->len);
+ str = rb_str_new5(orig, RSTRING(orig)->ptr, RSTRING(orig)->len);
OBJ_INFECT(str, orig);
if (RSTRING(str)->len == 0) return str;
@@ -1729,6 +1729,7 @@ rb_str_aset(str, indx, val)
idx += RSTRING(str)->len;
}
if (FIXNUM_P(val)) {
+ rb_str_modify(str);
if (RSTRING(str)->len == idx) {
RSTRING(str)->len += 1;
RESIZE_CAPA(str, RSTRING(str)->len);