From 1955257e85a23fafdc425d1951aeaaa3afebab96 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 11 Jul 2002 15:04:23 +0000 Subject: * ext/stringio/stringio.c (strio_gets_internal): fixed for record separator longer than 1. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/stringio/stringio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext') diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index 07ee38dd4..6a50fabae 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -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; -- cgit