| author | |
| committer | |
| log | 4fcb479de95775d056f378fdf8a0b9570bc315b7 |
| tree | a2a502cdedeb4b53dd2e6b22119a10c38e468391 |
| parent | 6038192fadbd785894368d483e98b9713b746135 |
2 files changed, 6 insertions(+), 2 deletions(-)
lib/std/Io.zig+3-1| ... | @@ -334,10 +334,12 @@ pub fn GenericReader( | ... | @@ -334,10 +334,12 @@ pub fn GenericReader( |
| 334 | fn stream(r: *Reader, w: *Writer, limit: Limit) Reader.StreamError!usize { | 334 | fn stream(r: *Reader, w: *Writer, limit: Limit) Reader.StreamError!usize { |
| 335 | const a: *@This() = @alignCast(@fieldParentPtr("new_interface", r)); | 335 | const a: *@This() = @alignCast(@fieldParentPtr("new_interface", r)); |
| 336 | const buf = limit.slice(try w.writableSliceGreedy(1)); | 336 | const buf = limit.slice(try w.writableSliceGreedy(1)); |
| 337 | return a.derp_reader.read(buf) catch |err| { | 337 | const n = a.derp_reader.read(buf) catch |err| { |
| 338 | a.err = err; | 338 | a.err = err; |
| 339 | return error.ReadFailed; | 339 | return error.ReadFailed; |
| 340 | }; | 340 | }; |
| 341 | w.advance(n); | ||
| 342 | return n; | ||
| 341 | } | 343 | } |
| 342 | }; | 344 | }; |
| 343 | }; | 345 | }; |
lib/std/Io/DeprecatedReader.zig+3-1| ... | @@ -393,10 +393,12 @@ pub const Adapter = struct { | ... | @@ -393,10 +393,12 @@ pub const Adapter = struct { |
| 393 | fn stream(r: *std.io.Reader, w: *std.io.Writer, limit: std.io.Limit) std.io.Reader.StreamError!usize { | 393 | fn stream(r: *std.io.Reader, w: *std.io.Writer, limit: std.io.Limit) std.io.Reader.StreamError!usize { |
| 394 | const a: *@This() = @alignCast(@fieldParentPtr("new_interface", r)); | 394 | const a: *@This() = @alignCast(@fieldParentPtr("new_interface", r)); |
| 395 | const buf = limit.slice(try w.writableSliceGreedy(1)); | 395 | const buf = limit.slice(try w.writableSliceGreedy(1)); |
| 396 | return a.derp_reader.read(buf) catch |err| { | 396 | const n = a.derp_reader.read(buf) catch |err| { |
| 397 | a.err = err; | 397 | a.err = err; |
| 398 | return error.ReadFailed; | 398 | return error.ReadFailed; |
| 399 | }; | 399 | }; |
| 400 | w.advance(n); | ||
| 401 | return n; | ||
| 400 | } | 402 | } |
| 401 | }; | 403 | }; |
| 402 | 404 |