зеркало из https://github.com/github/ruby.git
* string.c (rb_str_inspect): avoid exception by
"\#\xa1".force_encoding("euc-jp").inspect. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
36b4d1a1dc
Коммит
b8b0f6fd46
|
@ -1,3 +1,8 @@
|
|||
Sun Jan 27 19:51:15 2008 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* string.c (rb_str_inspect): avoid exception by
|
||||
"\#\xa1".force_encoding("euc-jp").inspect.
|
||||
|
||||
Sun Jan 27 19:07:33 2008 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* string.c (rb_str_succ): warning suppressed.
|
||||
|
|
8
string.c
8
string.c
|
@ -3311,9 +3311,11 @@ rb_str_inspect(VALUE str)
|
|||
|
||||
p += n;
|
||||
if (c == '"'|| c == '\\' ||
|
||||
(c == '#' && p < pend &&
|
||||
(cc = rb_enc_codepoint(p,pend,enc),
|
||||
(cc == '$' || cc == '@' || cc == '{')))) {
|
||||
(c == '#' &&
|
||||
p < pend &&
|
||||
MBCLEN_CHARFOUND(rb_enc_precise_mbclen(p,pend,enc)) &&
|
||||
(cc = rb_enc_codepoint(p,pend,enc),
|
||||
(cc == '$' || cc == '@' || cc == '{')))) {
|
||||
prefix_escape(result, c, enc);
|
||||
}
|
||||
else if (c == '\n') {
|
||||
|
|
Загрузка…
Ссылка в новой задаче