mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/stringio/stringio.c (strio_getline): fix for nil and "" as
separator. [ruby-dev:34591] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c93f203e53
commit
9e3e19cd1f
2 changed files with 7 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
Mon Jun 30 22:27:39 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* ext/stringio/stringio.c (strio_getline): fix for nil and "" as
|
||||
separator. [ruby-dev:34591]
|
||||
|
||||
Mon Jun 30 22:21:30 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* io.c (argf_each_line): pass args to each_line. [ruby-dev:34958]
|
||||
|
|
|
@ -835,7 +835,7 @@ strio_getline(int argc, VALUE *argv, struct StringIO *ptr)
|
|||
str = tmp;
|
||||
}
|
||||
}
|
||||
else {
|
||||
else if (!NIL_P(str)) {
|
||||
StringValue(str);
|
||||
}
|
||||
}
|
||||
|
@ -862,7 +862,7 @@ strio_getline(int argc, VALUE *argv, struct StringIO *ptr)
|
|||
s = p;
|
||||
while ((p = memchr(p, '\n', e - p)) && (p != e)) {
|
||||
if (*++p == '\n') {
|
||||
e = p;
|
||||
e = p + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue