zig/lib/std/Io
Ryan Liptak acd6ffdf69 Reader.peekDelimiterInclusive: Fix handling of stream implementations that return 0
Previously, the logic in peekDelimiterInclusive (when the delimiter was not found in the existing buffer) used the `n` returned from `r.vtable.stream` as the length of the slice to check, but it's valid for `vtable.stream` implementations to return 0 if they wrote to the buffer instead of `w`. In that scenario, the `indexOfScalarPos` would be given a 0-length slice so it would never be able to find the delimiter.

This commit changes the logic to assume that `r.vtable.stream` can both:
- return 0, and
- modify seek/end (i.e. it's also valid for a `vtable.stream` implementation to rebase)

Also introduces `std.testing.ReaderIndirect` which helps in being able to test against Reader implementations that return 0 from `stream`/`readVec`

Fixes #25428
2025-10-09 12:01:51 -07:00
..
Reader std.ArrayList: make unmanaged the default 2025-08-11 15:52:49 -07:00
counting_reader.zig
DeprecatedReader.zig std.ArrayList: make unmanaged the default 2025-08-11 15:52:49 -07:00
DeprecatedWriter.zig zig std: fix build failures 2025-08-08 17:17:53 -07:00
fixed_buffer_stream.zig std.Io: delete SeekableStream 2025-07-31 22:10:11 -07:00
Reader.zig Reader.peekDelimiterInclusive: Fix handling of stream implementations that return 0 2025-10-09 12:01:51 -07:00
test.zig std.Io: remove BufferedWriter 2025-08-08 17:17:53 -07:00
tty.zig
Writer.zig std.Io.Writer: fix upper case hex float formatting 2025-08-19 16:01:45 -07:00