diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-25 09:28:31 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-25 09:28:31 +0000 |
commit | 0eb5c917e06561a0ce8957702d21c93ec803216f (patch) | |
tree | 0d7c10e36e3aff4b05cf4c253f06d4060b9c530d /string.c | |
parent | ead329fd8ea6f0ecf11c6ec98e073eed6fe2810c (diff) | |
download | ruby-0eb5c917e06561a0ce8957702d21c93ec803216f.tar.gz |
* string.c (rb_str_each_line): don't call rb_enc_codepoint with empty
string.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -4310,7 +4310,7 @@ rb_str_each_line(int argc, VALUE *argv, VALUE str) int n = rb_enc_codelen(c, enc); if (rslen == 0 && c == newline) { - while (rb_enc_codepoint(p, pend, enc) == newline) { + while (p < pend && rb_enc_codepoint(p, pend, enc) == newline) { p += n; } p -= n; |