aboutsummaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-11 02:18:45 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-11 02:18:45 +0000
commit32f7ad36130eb97df6cae2c9e908b8556134e60a (patch)
tree1c228194956782b1c36da6487095315bfbef7c4b /string.c
parentc1a8666faf5a95e9bb9b1acb8f2fa3f1b9e46152 (diff)
downloadruby-32f7ad36130eb97df6cae2c9e908b8556134e60a.tar.gz
string.c: yield invalid part
* string.c (rb_enc_str_scrub): yield the invalid part only with ASCII-incompatible. [ruby-core:79039] [Bug #13120] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string.c b/string.c
index c01f2e595b..962848e4a7 100644
--- a/string.c
+++ b/string.c
@@ -9400,7 +9400,7 @@ rb_enc_str_scrub(rb_encoding *enc, VALUE str, VALUE repl)
rb_str_buf_cat(buf, rep, replen);
}
else {
- repl = rb_yield(rb_enc_str_new(p, e-p, enc));
+ repl = rb_yield(rb_enc_str_new(p, clen, enc));
repl = str_compat_and_valid(repl, enc);
tainted |= OBJ_TAINTED_RAW(repl);
rb_str_buf_cat(buf, RSTRING_PTR(repl), RSTRING_LEN(repl));