From bbc2f80a32b52b79586829e46ec97781456f9080 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 3 Mar 2008 08:22:18 +0000 Subject: [PATCH] * re.c (rb_reg_regsub): remove too strict encoding check. [ruby-dev:33966] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ re.c | 1 - test/ruby/test_m17n_comb.rb | 2 -- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index afb57284c0..5c92184198 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Mar 3 17:15:09 2008 Yukihiro Matsumoto + + * re.c (rb_reg_regsub): remove too strict encoding check. + [ruby-dev:33966] + Mon Mar 3 16:14:24 2008 Nobuyoshi Nakada * hash.c (rb_any_hash): shrinks all results in Fixnum range. diff --git a/re.c b/re.c index 61f6990d04..49424eb632 100644 --- a/re.c +++ b/re.c @@ -2960,7 +2960,6 @@ rb_reg_regsub(VALUE str, VALUE src, struct re_registers *regs, VALUE regexp) rb_encoding *str_enc = rb_enc_get(str); rb_encoding *src_enc = rb_enc_get(src); - rb_enc_check(str, src); p = s = RSTRING_PTR(str); e = s + RSTRING_LEN(str); diff --git a/test/ruby/test_m17n_comb.rb b/test/ruby/test_m17n_comb.rb index e69d6fadc8..ca527cc807 100644 --- a/test/ruby/test_m17n_comb.rb +++ b/test/ruby/test_m17n_comb.rb @@ -1417,7 +1417,6 @@ class TestM17NComb < Test::Unit::TestCase assert_equal(s1, doit.call) next end - assert(false, "test broken") if !str_enc_compatible?(s1.gsub(r2, ''), s3) assert_raise(ArgumentError, desc) { doit.call } next @@ -1472,7 +1471,6 @@ class TestM17NComb < Test::Unit::TestCase assert_equal([s1, nil], doit.call) next end - assert(false, "test broken") if !str_enc_compatible?(s1.gsub(r2, ''), s3) assert_raise(ArgumentError, desc) { doit.call } next