zig/lib
Ryan Liptak 328ae41468 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-08 16:42:55 -07:00
..
build-web webui: fixup build errors in fuzz / time_report 2025-09-06 18:51:26 -07:00
c compiler-rt: move strlen from libzigc to here 2025-08-30 06:36:41 +02:00
compiler resinator: Update for std.coff changes 2025-10-02 17:44:52 -04:00
compiler_rt improve impl of __sqrth, sqrtf, sqrt, __sqrtx and sqrtq (#25416) 2025-10-06 11:45:51 -07:00
docs std.fmt: delete deprecated APIs 2025-08-31 12:49:18 -07:00
include zig cc: update intrinsic headers to LLVM 21 2025-08-30 06:36:40 +02:00
init fix: fix typo in comment by removing repeated 'business' word 2025-08-24 23:00:17 +02:00
libc libc: update Linux headers to 6.17 2025-09-29 22:53:06 +02:00
libcxx llvm-libc: update to LLVM 21 2025-08-30 06:36:41 +02:00
libcxxabi libcxxabi: update to LLVM 21 2025-08-30 06:36:40 +02:00
libtsan libtsan: update to LLVM 21 2025-08-30 06:36:41 +02:00
libunwind libunwind: update to LLVM 21 2025-08-30 06:36:41 +02:00
std Reader.peekDelimiterInclusive: Fix handling of stream implementations that return 0 2025-10-08 16:42:55 -07:00
c.zig libc: use zig isnan and derivates for mingw 2025-08-27 03:58:32 +02:00
compiler_rt.zig compiler-rt: move strlen from libzigc to here 2025-08-30 06:36:41 +02:00
fuzzer.zig fuzzing: fix off-by-one in limit count 2025-09-25 17:16:10 -07:00
ubsan_rt.zig std.Io: delete GenericReader 2025-08-29 17:14:26 -07:00
zig.h cbe: workaround GCC miscompilation 2025-09-30 13:44:56 +01:00