mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/stringio/stringio.c (strio_gets_internal): fixed for record
separator longer than 1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
be1d2c5f68
commit
a9efb02c18
2 changed files with 7 additions and 2 deletions
|
@ -651,8 +651,8 @@ strio_gets_internal(argc, argv, ptr)
|
|||
str = rb_str_substr(ptr->string, ptr->pos, e - s);
|
||||
}
|
||||
else {
|
||||
if (n < s - e) {
|
||||
if (s - e < 1024) {
|
||||
if (n < e - s) {
|
||||
if (e - s < 1024) {
|
||||
for (p = s; p + n <= e; ++p) {
|
||||
if (MEMCMP(p, RSTRING(str)->ptr, char, n) == 0) {
|
||||
e = p + n;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue