mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/stringio/stringio.c (strio_getline): suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
15b12588ab
commit
15741e262e
1 changed files with 2 additions and 3 deletions
|
@ -863,8 +863,7 @@ strio_getline(argc, argv, ptr)
|
|||
}
|
||||
}
|
||||
s = p;
|
||||
while (p = memchr(p, '\n', e - p)) {
|
||||
if (p == e) break;
|
||||
while ((p = memchr(p, '\n', e - p)) && (p != e)) {
|
||||
if (*++p == '\n') {
|
||||
e = p;
|
||||
break;
|
||||
|
@ -873,7 +872,7 @@ strio_getline(argc, argv, ptr)
|
|||
str = rb_str_substr(ptr->string, s - RSTRING(ptr->string)->ptr, e - s);
|
||||
}
|
||||
else if (n == 1) {
|
||||
if (p = memchr(s, RSTRING(str)->ptr[0], e - s)) {
|
||||
if ((p = memchr(s, RSTRING(str)->ptr[0], e - s)) != 0) {
|
||||
e = p + 1;
|
||||
}
|
||||
str = rb_str_substr(ptr->string, ptr->pos, e - s);
|
||||
|
|
Loading…
Reference in a new issue