From 265aaee91cc9ebe9015df33c11176870a66bb9cd Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 3 Jan 2007 10:12:02 +0000 Subject: [PATCH] * io.c (rb_io_getline): lineno update condition was wrong. [ruby-dev:30065] * io.c (rb_io_getline_fast): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ io.c | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3a0074b686..4b3d499799 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Wed Jan 3 18:49:15 2007 Yukihiro Matsumoto + + * io.c (rb_io_getline): lineno update condition was wrong. + [ruby-dev:30065] + + * io.c (rb_io_getline_fast): ditto. + Wed Jan 3 11:36:51 2007 Yukihiro Matsumoto * io.c (ruby_dup): start GC on ENOMEM as well. diff --git a/io.c b/io.c index 9e8710897c..35c406a2a3 100644 --- a/io.c +++ b/io.c @@ -1644,7 +1644,7 @@ rb_io_getline_fast(OpenFile *fptr, unsigned char delim, long limit) } if (!NIL_P(str)) { - if (limit > 0) { + if (limit != 0) { fptr->lineno++; lineno = INT2FIX(fptr->lineno); } @@ -1740,7 +1740,7 @@ rb_io_getline(int argc, VALUE *argv, VALUE io) } if (!NIL_P(str)) { - if (limit > 0) { + if (limit != 0) { fptr->lineno++; lineno = INT2FIX(fptr->lineno); }