authorgravatar for ian@ianjohnson.devIan Johnson <ian@ianjohnson.dev> 2023-08-10 21:36:21-04:00
committergravatar for kappaloris@gmail.comLoris Cro <kappaloris@gmail.com> 2023-08-17 12:38:53+02:00
log5395c2786a2ea9fd70e8c91aab099976216089aa
tree70e0c3070ac732d56f44fe0f8f58ba2032c2d60f
parent000aa30086eb4b470d2b567ce377f0e4a9d9a516

Autodoc: fix guide path resolution

The previous logic was using `root_src_directory` both in constructing the resolved path and as the root when opening the resolved path, which effectively duplicates those path components in the final path.

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

src/Autodoc.zig+1-2
......@@ -5537,9 +5537,8 @@ fn findGuidePaths(self: *Autodoc, file: *File, str: []const u8) ![]const u8 {
55375537fn addGuide(self: *Autodoc, file: *File, guide_path: []const u8, section: *Section) !void {
55385538 if (guide_path.len == 0) return error.MissingAutodocGuideName;
55395539
5540 const cur_mod_dir_path = file.pkg.root_src_directory.path orelse ".";
55415540 const resolved_path = try std.fs.path.resolve(self.arena, &[_][]const u8{
5542 cur_mod_dir_path, file.sub_file_path, "..", guide_path,
5541 file.sub_file_path, "..", guide_path,
55435542 });
55445543
55455544 var guide_file = try file.pkg.root_src_directory.handle.openFile(resolved_path, .{});