From 3b983407ef254cf1908f844fecb4d8b3a02f9a67 Mon Sep 17 00:00:00 2001 From: glass Date: Sat, 5 Jan 2013 04:45:32 +0000 Subject: * string.c (rb_str_enumerate_lines): fix invalid byte sequence error when a separator is passed. The patch is from yoshidam (Yoshida Masato). [Bug #7646] [ruby-dev:46827] * test/ruby/test_string.rb: a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_string.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index e988f99629..7b4dc2951d 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -760,6 +760,11 @@ class TestString < Test::Unit::TestCase assert_equal "hello\n", S("hello\nworld").each_line.next assert_equal "hello\nworld", S("hello\nworld").each_line(nil).next + + bug7646 = "[ruby-dev:46827]" + assert_nothing_raised(bug7646) do + "\n\u0100".each_line("\n") {} + end end def test_lines -- cgit v1.2.3