Commit 3d25a9c1e0

Andrew Kelley <andrew@ziglang.org>
2025-08-08 23:20:55
std.Io.Writer.Allocating.sendFile: use logicalPos
fixes #24754 tested with `zig build test-std -Dskip-release`
1 parent 6219c01
Changed files (1)
lib
std
lib/std/Io/Writer.zig
@@ -2634,7 +2634,7 @@ pub const Allocating = struct {
         const gpa = a.allocator;
         var list = a.toArrayList();
         defer setArrayList(a, list);
-        const pos = file_reader.pos;
+        const pos = file_reader.logicalPos();
         const additional = if (file_reader.getSize()) |size| size - pos else |_| std.atomic.cache_line;
         if (additional == 0) return error.EndOfStream;
         list.ensureUnusedCapacity(gpa, limit.minInt64(additional)) catch return error.WriteFailed;