diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-27 07:36:54 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-27 07:36:54 +0000 |
| commit | 772d79be859721f42f3c3c85379f7124984564c9 (patch) | |
| tree | 63384780dff3510988cc23847845007a1cf4a8af /string.c | |
| parent | 5385023112af199efa6cf1837fe65349abb5d2c7 (diff) | |
| download | ruby-772d79be859721f42f3c3c85379f7124984564c9.tar.gz ruby-772d79be859721f42f3c3c85379f7124984564c9.tar.xz ruby-772d79be859721f42f3c3c85379f7124984564c9.zip | |
* string.c (chopped_length): get rid of unexpected exception.
see [ruby-core:26336].
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
| -rw-r--r-- | string.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -5925,9 +5925,9 @@ chopped_length(VALUE str) if (beg > end) return 0; p = rb_enc_prev_char(beg, end, end, enc); if (!p) return 0; - if (p > beg && rb_enc_codepoint(p, end, enc) == '\n') { + if (p > beg && rb_enc_ascget(p, end, 0, enc) == '\n') { p2 = rb_enc_prev_char(beg, p, end, enc); - if (p2 && rb_enc_codepoint(p2, end, enc) == '\r') p = p2; + if (p2 && rb_enc_ascget(p2, end, 0, enc) == '\r') p = p2; } return p - beg; } |
