mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 21:49:06 +02:00
* string.c (rb_str_inspect): don't call rb_enc_codepoint with empty
string. fix '#'.inspect. * encoding.c (rb_enc_codepoint): raise on empty string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8e4c6d8482
commit
ead329fd8e
3 changed files with 13 additions and 2 deletions
3
string.c
3
string.c
|
@ -3025,7 +3025,8 @@ rb_str_inspect(VALUE str)
|
|||
|
||||
p += n;
|
||||
if (c == '"'|| c == '\\' ||
|
||||
(c == '#' && (cc = rb_enc_codepoint(p,pend,enc),
|
||||
(c == '#' && p < pend &&
|
||||
(cc = rb_enc_codepoint(p,pend,enc),
|
||||
(cc == '$' || cc == '@' || cc == '{')))) {
|
||||
prefix_escape(result, c, enc);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue