diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-08-16 02:52:25 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-08-16 02:52:25 +0000 |
| commit | 16cfb5367f78c3d2d7cff66bad488aef2aeb7eaa (patch) | |
| tree | 6036f34b37a752dbc9708aa110a936a13484b5a7 /io.c | |
| parent | 41232378fceb3d2d113af3573df675203ae3d896 (diff) | |
| download | ruby-16cfb5367f78c3d2d7cff66bad488aef2aeb7eaa.tar.gz ruby-16cfb5367f78c3d2d7cff66bad488aef2aeb7eaa.tar.xz ruby-16cfb5367f78c3d2d7cff66bad488aef2aeb7eaa.zip | |
* io.c (rb_io_fread): renamed from io_fread and made extern.
* marshal.c (r_bytes0): check if successfully read, use
rb_io_fread() instead of fread() to be preemptive.
(ruby-bugs-ja:PR#294, 295)
* rubyio.h (rb_io_fread): added.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
| -rw-r--r-- | io.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -542,8 +542,8 @@ rb_io_to_io(io) /* reading functions */ -static long -io_fread(ptr, len, f) +long +rb_io_fread(ptr, len, f) char *ptr; long len; FILE *f; @@ -650,7 +650,7 @@ read_all(fptr, siz) if (!siz) siz = BUFSIZ; str = rb_tainted_str_new(0, siz); for (;;) { - n = io_fread(RSTRING(str)->ptr+bytes, siz-bytes, fptr->f); + n = rb_io_fread(RSTRING(str)->ptr+bytes, siz-bytes, fptr->f); if (n == 0 && bytes == 0) { if (feof(fptr->f)) return Qnil; rb_sys_fail(fptr->path); @@ -694,7 +694,7 @@ io_read(argc, argv, io) if (len == 0) return str; READ_CHECK(fptr->f); - n = io_fread(RSTRING(str)->ptr, len, fptr->f); + n = rb_io_fread(RSTRING(str)->ptr, len, fptr->f); if (n == 0) { if (feof(fptr->f)) return Qnil; rb_sys_fail(fptr->path); |
