summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-01 07:11:40 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-01 07:11:40 +0000
commitb3c42a2e4193efc0ee3eb565a3510cf7efe7f75a (patch)
treecd071e74d43dfea5ec4c6fb4dd0d21607ecd2bd9
parentf2d2dfe9ca4a50bc88a5c3ff8242433f82ea7e75 (diff)
merge revision(s) 26103:
* string.c (rb_str_inspect): wrong result of UTF-8 inspect because of the mistake of calculation. reported by eban via IRC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@27145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--string.c2
-rw-r--r--test/ruby/test_string.rb2
-rw-r--r--version.h10
4 files changed, 12 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 2e30630260..5aecf003a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Apr 1 05:32:17 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * string.c (rb_str_inspect): wrong result of UTF-8 inspect because of
+ the mistake of calculation. reported by eban via IRC.
+
Sun Jan 10 19:00:31 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/webrick/accesslog.rb : Escape needed.
diff --git a/string.c b/string.c
index 69430c6cfc..c6b2301874 100644
--- a/string.c
+++ b/string.c
@@ -2642,7 +2642,7 @@ rb_str_inspect(str)
while (p < pend) {
char c = *p++;
int len;
- if (ismbchar(c) && p + (len = mbclen(c)) <= pend) {
+ if (ismbchar(c) && p - 1 + (len = mbclen(c)) <= pend) {
rb_str_buf_cat(result, p - 1, len);
p += len - 1;
}
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb
index cb1bd575e5..5f2c54f44a 100644
--- a/test/ruby/test_string.rb
+++ b/test/ruby/test_string.rb
@@ -24,7 +24,7 @@ class TestString < Test::Unit::TestCase
assert_equal('"\343\201\202"', "\xe3\x81\x82".inspect)
$KCODE = 'u'
- assert_equal('"\\343\\201\\202"', "\xe3\x81\x82".inspect)
+ assert_equal("\"\343\201\202\"", "\xe3\x81\x82".inspect)
assert_no_match(/\0/, "\xe3\x81".inspect, '[ruby-dev:39550]')
ensure
$KCODE = original_kcode
diff --git a/version.h b/version.h
index e2c372c202..fb30f9b5a0 100644
--- a/version.h
+++ b/version.h
@@ -1,15 +1,15 @@
#define RUBY_VERSION "1.8.7"
-#define RUBY_RELEASE_DATE "2010-01-10"
+#define RUBY_RELEASE_DATE "2010-04-01"
#define RUBY_VERSION_CODE 187
-#define RUBY_RELEASE_CODE 20100110
-#define RUBY_PATCHLEVEL 249
+#define RUBY_RELEASE_CODE 20100401
+#define RUBY_PATCHLEVEL 250
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8
#define RUBY_VERSION_TEENY 7
#define RUBY_RELEASE_YEAR 2010
-#define RUBY_RELEASE_MONTH 1
-#define RUBY_RELEASE_DAY 10
+#define RUBY_RELEASE_MONTH 4
+#define RUBY_RELEASE_DAY 1
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];