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
|
@ -1,3 +1,8 @@
|
||||||
|
Fri Jul 12 00:02:50 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
|
* ext/stringio/stringio.c (strio_gets_internal): fixed for record
|
||||||
|
separator longer than 1.
|
||||||
|
|
||||||
Thu Jul 11 12:59:23 2002 Shugo Maeda <shugo@ruby-lang.org>
|
Thu Jul 11 12:59:23 2002 Shugo Maeda <shugo@ruby-lang.org>
|
||||||
|
|
||||||
* lib/resolv.rb: untaint strings read from /etc/hosts and
|
* lib/resolv.rb: untaint strings read from /etc/hosts and
|
||||||
|
|
|
@ -651,8 +651,8 @@ strio_gets_internal(argc, argv, ptr)
|
||||||
str = rb_str_substr(ptr->string, ptr->pos, e - s);
|
str = rb_str_substr(ptr->string, ptr->pos, e - s);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (n < s - e) {
|
if (n < e - s) {
|
||||||
if (s - e < 1024) {
|
if (e - s < 1024) {
|
||||||
for (p = s; p + n <= e; ++p) {
|
for (p = s; p + n <= e; ++p) {
|
||||||
if (MEMCMP(p, RSTRING(str)->ptr, char, n) == 0) {
|
if (MEMCMP(p, RSTRING(str)->ptr, char, n) == 0) {
|
||||||
e = p + n;
|
e = p + n;
|
||||||
|
|
Loading…
Reference in a new issue