summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-05 15:05:48 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-05 15:05:48 +0000
commit91538a3882bcb23f9f93f7738da34d4370f54558 (patch)
tree8ebba24fcb0d434742f7a0ae5dd476187bdbab60
parent61b8250adc1bca756e92174aa90a49e55efd2804 (diff)
* string.c (String#b): Allow code range scan to happen later so
ascii_only? on a result string returns the correct value. [ruby-core:55315] [Bug #8496] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--string.c2
-rw-r--r--test/ruby/test_m17n.rb2
3 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 0cb44ddd54b..6700e1f6f0d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Jun 6 00:05:08 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * string.c (String#b): Allow code range scan to happen later so
+ ascii_only? on a result string returns the correct value.
+ [ruby-core:55315] [Bug #8496]
+
Wed Jun 5 22:40:42 2013 Shugo Maeda <shugo@ruby-lang.org>
* lib/net/imap.rb (capability_response): should ignore trailing
diff --git a/string.c b/string.c
index 6aeb029f2f9..4111e963c75 100644
--- a/string.c
+++ b/string.c
@@ -7624,7 +7624,7 @@ rb_str_b(VALUE str)
VALUE str2 = str_alloc(rb_cString);
str_replace_shared_without_enc(str2, str);
OBJ_INFECT(str2, str);
- ENC_CODERANGE_SET(str2, ENC_CODERANGE_VALID);
+ ENC_CODERANGE_CLEAR(str2);
return str2;
}
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb
index 98f79b3f76e..edc8e4c28f7 100644
--- a/test/ruby/test_m17n.rb
+++ b/test/ruby/test_m17n.rb
@@ -1488,6 +1488,8 @@ class TestM17N < Test::Unit::TestCase
assert_equal(true, s.b.tainted?)
s.untrust
assert_equal(true, s.b.untrusted?)
+ s = "abc".b
+ assert_equal(true, s.b.ascii_only?)
end
def test_scrub