string.c: byte offset

* string.c (rb_pat_search): advance by byte offset but not by char
  offset.  [ruby-core:62669] [Bug #9849]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-05-19 07:29:51 +00:00
parent 72c773b15d
commit 8fb925dfcd
3 changed files with 15 additions and 5 deletions

View file

@ -834,6 +834,9 @@ class TestString < Test::Unit::TestCase
assert_equal Encoding::UTF_8, a.gsub(/world/, c).encoding
assert_equal S("a\u{e9}apos&lt;"), S("a\u{e9}'&lt;").gsub("'", "apos")
bug9849 = '[ruby-core:62669] [Bug #9849]'
assert_equal S("\u{3042 3042 3042}!foo!"), S("\u{3042 3042 3042}/foo/").gsub("/", "!"), bug9849
end
def test_gsub!