diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-25 09:07:32 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-25 09:07:32 +0000 |
| commit | 2936600385283d3e320b72ed6a70882805599411 (patch) | |
| tree | 058477d4c73b52a1dee3635363c5a947a54c7b5d /string.c | |
| parent | bc02b02778ca73eb64e803216e19650cd224798f (diff) | |
| download | ruby-2936600385283d3e320b72ed6a70882805599411.tar.gz ruby-2936600385283d3e320b72ed6a70882805599411.tar.xz ruby-2936600385283d3e320b72ed6a70882805599411.zip | |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@14687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
| -rw-r--r-- | string.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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); } |
