1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
akr 2007-12-25 09:28:31 +00:00
parent ead329fd8e
commit 0eb5c917e0
2 changed files with 6 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Tue Dec 25 18:27:51 2007 Tanaka Akira <akr@fsij.org>
* string.c (rb_str_each_line): don't call rb_enc_codepoint with empty
string.
Tue Dec 25 18:06:04 2007 Tanaka Akira <akr@fsij.org>
* string.c (rb_str_inspect): don't call rb_enc_codepoint with empty

View file

@ -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;