diff options
| author | Roy Frostig <[email protected]> | 2010-08-19 17:37:22 -0700 |
|---|---|---|
| committer | Roy Frostig <[email protected]> | 2010-08-19 17:37:22 -0700 |
| commit | 4a7aa75b5df2dba14ee03fb3a4d87a33ec0fd6dd (patch) | |
| tree | e32837f9692a47d4415d8bd80e8f53aaa64d781d /src/lib/_io.rs | |
| parent | Export all item code to stabs on Windows (including e.g. object methods) (diff) | |
| download | rust-4a7aa75b5df2dba14ee03fb3a4d87a33ec0fd6dd.tar.xz rust-4a7aa75b5df2dba14ee03fb3a4d87a33ec0fd6dd.zip | |
Make _io.buf_reader read more than 0 bytes at a time.
Diffstat (limited to 'src/lib/_io.rs')
| -rw-r--r-- | src/lib/_io.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/_io.rs b/src/lib/_io.rs index a7feba2f..5583815f 100644 --- a/src/lib/_io.rs +++ b/src/lib/_io.rs @@ -48,7 +48,7 @@ fn new_buf_reader(str path) -> buf_reader { buf = new_buf(); } - auto len = _vec.len[u8](buf); + auto len = default_bufsz(); auto vbuf = _vec.buf[u8](buf); auto count = os.libc.read(fd, vbuf, len); @@ -56,9 +56,10 @@ fn new_buf_reader(str path) -> buf_reader { log "error filling buffer"; log sys.rustrt.last_os_error(); fail; - } else { - ret buf; } + + _vec.len_set[u8](buf, count as uint); + ret buf; } drop { |