summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-07-11 15:04:23 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-07-11 15:04:23 +0000
commit1955257e85a23fafdc425d1951aeaaa3afebab96 (patch)
treeb0a1347d7a3a2b8183ce521d99b426067aa7d11b
parent350aee1bdacbc128730a86b22e93001a99b785dd (diff)
downloadruby-1955257e85a23fafdc425d1951aeaaa3afebab96.tar.gz
ruby-1955257e85a23fafdc425d1951aeaaa3afebab96.tar.xz
ruby-1955257e85a23fafdc425d1951aeaaa3afebab96.zip
* 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
-rw-r--r--ChangeLog5
-rw-r--r--ext/stringio/stringio.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index d5022d325..2e14cf819 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
* lib/resolv.rb: untaint strings read from /etc/hosts and
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;