diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-28 11:27:42 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-28 11:27:42 +0000 |
| commit | d29405a1efc10ae7384d4955164539ebb576982c (patch) | |
| tree | 684d882a2c450ce029a8e506f8721c6ecd3a98f6 | |
| parent | 5db6e0da7bf15a42025cc65e119fada6db597454 (diff) | |
| download | ruby-d29405a1efc10ae7384d4955164539ebb576982c.tar.gz ruby-d29405a1efc10ae7384d4955164539ebb576982c.tar.xz ruby-d29405a1efc10ae7384d4955164539ebb576982c.zip | |
* ext/stringio/stringio.c (strio_sysread): StringIO.new.sysread didn't
raise EOFError.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 8 | ||||
| -rw-r--r-- | ext/stringio/stringio.c | 2 | ||||
| -rw-r--r-- | ext/zlib/zlib.c | 2 |
3 files changed, 10 insertions, 2 deletions
@@ -1,3 +1,11 @@ +Sun Dec 28 20:19:11 2003 Tanaka Akira <akr@m17n.org> + + * 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 <dave@pragprog.com> * 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 8d3275b2b..46217c7bc 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 80b45ad0c..e22d98840 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; } |
