aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-03-06 22:51:26 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-03-10 17:51:07 -0700
commit8b70e4f2c9de4aa90c6b4971626994415825f7af (patch)
tree03d140ec53d3bee1bbcc0cd28af1657c995eb671 /src
parent8dcc35e5ce51819173420540853e028dfe06f491 (diff)
downloadzig-8b70e4f2c9de4aa90c6b4971626994415825f7af.tar.gz
zig-8b70e4f2c9de4aa90c6b4971626994415825f7af.zip
autodocs: fix root name and missing dir close
Diffstat (limited to 'src')
-rw-r--r--src/Compilation.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index 9023fc99ab..132dd37fbf 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -3805,13 +3805,13 @@ fn docsCopyFallible(comp: *Compilation) anyerror!void {
defer tar_file.close();
const root = comp.root_mod.root;
- const root_mod_name = comp.root_mod.fully_qualified_name;
const sub_path = if (root.sub_path.len == 0) "." else root.sub_path;
var mod_dir = root.root_dir.handle.openDir(sub_path, .{ .iterate = true }) catch |err| {
return comp.lockAndSetMiscFailure(.docs_copy, "unable to open directory '{}': {s}", .{
root, @errorName(err),
});
};
+ defer mod_dir.close();
var walker = try mod_dir.walk(comp.gpa);
defer walker.deinit();
@@ -3843,7 +3843,7 @@ fn docsCopyFallible(comp: *Compilation) anyerror!void {
var file_header = std.tar.output.Header.init();
file_header.typeflag = .regular;
- try file_header.setPath(root_mod_name, entry.path);
+ try file_header.setPath(comp.root_name, entry.path);
try file_header.setSize(stat.size);
try file_header.updateChecksum();