aboutsummaryrefslogtreecommitdiff
path: root/src/libarchive/libarchive.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/libarchive/libarchive.zig')
-rw-r--r--src/libarchive/libarchive.zig8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libarchive/libarchive.zig b/src/libarchive/libarchive.zig
index ebce0cba4..117f2809f 100644
--- a/src/libarchive/libarchive.zig
+++ b/src/libarchive/libarchive.zig
@@ -460,6 +460,9 @@ pub const Archive = struct {
Status.eof => break :loop,
Status.failed, Status.fatal, Status.retry => return error.Fail,
else => {
+ // do not use the utf8 name there
+ // it will require us to pull in libiconv
+ // though we should probably validate the utf8 here nonetheless
var pathname: [:0]const u8 = std.mem.sliceTo(lib.archive_entry_pathname(entry).?, 0);
var tokenizer = std.mem.tokenize(u8, std.mem.span(pathname), std.fs.path.sep_str);
comptime var depth_i: usize = 0;
@@ -511,6 +514,7 @@ pub const Archive = struct {
ctx: ?*Archive.Context,
comptime depth_to_skip: usize,
comptime close_handles: bool,
+ comptime log: bool,
) !u32 {
var entry: *lib.archive_entry = undefined;
var ext: *lib.archive = undefined;
@@ -559,7 +563,9 @@ pub const Archive = struct {
const mask = lib.archive_entry_filetype(entry);
const size = @intCast(usize, std.math.max(lib.archive_entry_size(entry), 0));
if (size > 0) {
- Output.prettyln(" {s}", .{pathname});
+ if (comptime log) {
+ Output.prettyln(" {s}", .{pathname});
+ }
const file = dir.createFileZ(pathname, .{ .truncate = true }) catch |err| brk: {
switch (err) {