1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* string.c (rb_str_inspect): CHAR_ESC_LEN should be 13.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2009-12-10 00:26:41 +00:00
parent 17897462b2
commit e5dc8988af
3 changed files with 6 additions and 2 deletions

View file

@ -1,3 +1,7 @@
Thu Dec 10 09:15:00 2009 NARUSE, Yui <naruse@ruby-lang.org>
* string.c (rb_str_inspect): CHAR_ESC_LEN should be 13.
Thu Dec 10 01:12:55 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (dyna_pop_gen): pop dvars. [ruby-dev:39861]

View file

@ -4048,7 +4048,7 @@ rb_str_inspect(VALUE str)
{
rb_encoding *enc = STR_ENC_GET(str);
const char *p, *pend, *prev;
#define CHAR_ESC_LEN 12 /* sizeof(\x{ hex of 32bit unsigned int }) */
#define CHAR_ESC_LEN 13 /* sizeof(\x{ hex of 32bit unsigned int } \0) */
char buf[CHAR_ESC_LEN + 1];
VALUE result = rb_str_buf_new(0);
rb_encoding *resenc = rb_default_internal_encoding();

View file

@ -200,7 +200,7 @@ class TestM17N < Test::Unit::TestCase
assert_equal('"\xF8\x80\x80\x80 "', u("\xf8\x80\x80\x80 ").inspect)
assert_equal('"\xFC\x80\x80\x80\x80 "', u("\xfc\x80\x80\x80\x80 ").inspect)
assert_equal('"\x{81308130}"', "\x81\x30\x81\x30".force_encoding('GB18030').inspect)
assert_equal("\"\\xA1\\x{8FA1A1}\"", e("\xa1\x8f\xa1\xa1").inspect)
assert_equal('"\x81."', s("\x81.").inspect)