summaryrefslogtreecommitdiff
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
commit26adfc185fac192ba0d0f3f75e40159a972a9fe5 (patch)
tree06d41d47ccfae664671557ae83098d7a72ecf81d /string.c
parent1b56bcce22a069eba6afb7e36f654783e5b4fbbc (diff)
* 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: svn+ssh://ci.ruby-lang.org/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 3eaeb9e5db..e20007f0b9 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);
}