From 1a95e46cc6194933cf75a4bf91a0bb6502f177a0 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 22 Jul 2014 03:56:26 +0000 Subject: [PATCH] string.c: fix wrong single-byte optimization * string.c (rb_str_count): fix wrong single-byte optimization. 7bit ascii can be a trailing byte in Shift_JIS. [ruby-dev:48442] [Bug #10078] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ string.c | 6 ++++-- test/ruby/test_m17n.rb | 5 +++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 59f8e78d8b..5c50f32789 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Jul 22 12:56:24 2014 Nobuyoshi Nakada + + * string.c (rb_str_count): fix wrong single-byte optimization. + 7bit ascii can be a trailing byte in Shift_JIS. + [ruby-dev:48442] [Bug #10078] + Tue Jul 22 01:48:38 2014 Eric Wong * include/ruby/io.h (rb_io_buffer_t): fix packing on gcc diff --git a/string.c b/string.c index 4feb7cfc2e..b303b56d89 100644 --- a/string.c +++ b/string.c @@ -6075,13 +6075,15 @@ rb_str_count(int argc, VALUE *argv, VALUE str) rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS); for (i=0; i