diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-07-26 13:43:17 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-07-26 20:00:25 -0700 |
| commit | 04614d6ea17fff69ead42223c35a257da25462de (patch) | |
| tree | 74ef210295b8cd105567c6a303aaacb984007a3a /lib/std/Io.zig | |
| parent | de39c5f67ffec18b9a5aa51e84dbf5f04ce013bc (diff) | |
| download | zig-04614d6ea17fff69ead42223c35a257da25462de.tar.gz zig-04614d6ea17fff69ead42223c35a257da25462de.zip | |
std.Io.Reader: add rebase to the vtable
This eliminates a footgun and special case handling with fixed buffers,
as well as allowing decompression streams to keep a window in the output
buffer.
Diffstat (limited to 'lib/std/Io.zig')
| -rw-r--r-- | lib/std/Io.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/std/Io.zig b/lib/std/Io.zig index 1ab5d13cab..1511f0dcad 100644 --- a/lib/std/Io.zig +++ b/lib/std/Io.zig @@ -757,7 +757,7 @@ pub fn Poller(comptime StreamEnum: type) type { const unused = r.buffer[r.end..]; if (unused.len >= min_len) return unused; } - if (r.seek > 0) r.rebase(); + if (r.seek > 0) r.rebase(r.buffer.len) catch unreachable; { var list: std.ArrayListUnmanaged(u8) = .{ .items = r.buffer[0..r.end], |
