summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 d5022d3..2e14cf8 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 07ee38d..6a50fab 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;