From 9d312f635b6b850efaee09dcfc48a0af41f4f1a6 Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 28 Dec 2003 11:34:11 +0000 Subject: * ext/stringio/stringio.c (strio_sysread): StringIO.new.sysread didn't raise EOFError. * ext/zlib/zlib.c (gzreader_gets): don't increment lineno when gzfile_read_all returns "". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 ++++++++ ext/stringio/stringio.c | 2 +- ext/zlib/zlib.c | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5fddfeffb7..d66278f4a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Sun Dec 28 20:19:11 2003 Tanaka Akira + + * ext/stringio/stringio.c (strio_sysread): StringIO.new.sysread didn't + raise EOFError. + + * ext/zlib/zlib.c (gzreader_gets): don't increment lineno when + gzfile_read_all returns "". + Sun Dec 28 15:25:08 2003 Dave Thomas * class.c,object.c,parse.y,sprintf.c,variable.c: Document classes diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index 8d3275b2b8..46217c7bc8 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -908,7 +908,7 @@ strio_sysread(argc, argv, self) VALUE self; { VALUE val = strio_read(argc, argv, self); - if (NIL_P(val)) { + if (NIL_P(val) || RSTRING(val)->len == 0) { rb_eof_error(); } return val; diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 80b45ad0c9..e22d988406 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -2486,7 +2486,7 @@ gzreader_gets(argc, argv, obj) if (NIL_P(rs)) { dst = gzfile_read_all(gz); - if (!NIL_P(dst)) gz->lineno++; + if (RSTRING(dst)->len != 0) gz->lineno++; return dst; } -- cgit v1.2.3