summaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-15 08:04:10 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-15 08:04:10 +0000
commit583a15023413b8b9462178b6a90e538794dd3976 (patch)
tree06d41d47ccfae664671557ae83098d7a72ecf81d /string.c
parent50de0d6a1d308c0586bd67070703af41b33f80ac (diff)
downloadruby-583a15023413b8b9462178b6a90e538794dd3976.tar.gz
ruby-583a15023413b8b9462178b6a90e538794dd3976.tar.xz
ruby-583a15023413b8b9462178b6a90e538794dd3976.zip
* encoding.c (rb_enc_associate_index, rb_enc_get_index): check if
object is encoding capable. [ruby-dev:31780] * string.c (rb_str_subpat_set): check for if the argument is a String. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/string.c b/string.c
index 3eaeb9e5d..e20007f0b 100644
--- a/string.c
+++ b/string.c
@@ -1996,6 +1996,7 @@ rb_str_subpat_set(VALUE str, VALUE re, int nth, VALUE val)
}
end = RMATCH(match)->END(nth);
len = end - start;
+ StringValue(val);
rb_enc_check(str, val);
rb_str_splice_0(str, start, len, val);
}