authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-03-06 22:51:26-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-03-10 17:51:07-07:00
log8b70e4f2c9de4aa90c6b4971626994415825f7af
tree03d140ec53d3bee1bbcc0cd28af1657c995eb671
parent8dcc35e5ce51819173420540853e028dfe06f491

autodocs: fix root name and missing dir close


1 files changed, 2 insertions(+), 2 deletions(-)

src/Compilation.zig+2-2
...@@ -3805,13 +3805,13 @@ fn docsCopyFallible(comp: *Compilation) anyerror!void {...@@ -3805,13 +3805,13 @@ fn docsCopyFallible(comp: *Compilation) anyerror!void {
3805 defer tar_file.close();3805 defer tar_file.close();
38063806
3807 const root = comp.root_mod.root;3807 const root = comp.root_mod.root;
3808 const root_mod_name = comp.root_mod.fully_qualified_name;
3809 const sub_path = if (root.sub_path.len == 0) "." else root.sub_path;3808 const sub_path = if (root.sub_path.len == 0) "." else root.sub_path;
3810 var mod_dir = root.root_dir.handle.openDir(sub_path, .{ .iterate = true }) catch |err| {3809 var mod_dir = root.root_dir.handle.openDir(sub_path, .{ .iterate = true }) catch |err| {
3811 return comp.lockAndSetMiscFailure(.docs_copy, "unable to open directory '{}': {s}", .{3810 return comp.lockAndSetMiscFailure(.docs_copy, "unable to open directory '{}': {s}", .{
3812 root, @errorName(err),3811 root, @errorName(err),
3813 });3812 });
3814 };3813 };
3814 defer mod_dir.close();
38153815
3816 var walker = try mod_dir.walk(comp.gpa);3816 var walker = try mod_dir.walk(comp.gpa);
3817 defer walker.deinit();3817 defer walker.deinit();
...@@ -3843,7 +3843,7 @@ fn docsCopyFallible(comp: *Compilation) anyerror!void {...@@ -3843,7 +3843,7 @@ fn docsCopyFallible(comp: *Compilation) anyerror!void {
38433843
3844 var file_header = std.tar.output.Header.init();3844 var file_header = std.tar.output.Header.init();
3845 file_header.typeflag = .regular;3845 file_header.typeflag = .regular;
3846 try file_header.setPath(root_mod_name, entry.path);3846 try file_header.setPath(comp.root_name, entry.path);
3847 try file_header.setSize(stat.size);3847 try file_header.setSize(stat.size);
3848 try file_header.updateChecksum();3848 try file_header.updateChecksum();
38493849