From b3ad45f267f4402855613f100c82b12f950b8143 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 28 Feb 2024 20:14:21 -0700 Subject: [PATCH] std.tar: avoid dependency on file system In the iterator function which is the low-level API, don't depend on `std.fs.MAX_PATH_BYTES` because this is not defined on all operating systems, such as freestanding. However in such environments it still makes sense to be able to extract from a tar file. An even more flexible solution would be to accept the buffers as arguments to iterator() which I think is a good idea, but for now let's just set the same upper limmit across all operating systems. --- lib/std/tar.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/std/tar.zig b/lib/std/tar.zig index a224384925..dbdb606cb5 100644 --- a/lib/std/tar.zig +++ b/lib/std/tar.zig @@ -247,8 +247,8 @@ fn Iterator(comptime ReaderType: type) type { // buffers for heeader and file attributes header_buffer: [Header.SIZE]u8 = undefined, - file_name_buffer: [std.fs.MAX_PATH_BYTES]u8 = undefined, - link_name_buffer: [std.fs.MAX_PATH_BYTES]u8 = undefined, + file_name_buffer: [1024]u8 = undefined, + link_name_buffer: [1024]u8 = undefined, // bytes of padding to the end of the block padding: usize = 0,