From 62023c60b4809aee5b23a62c70927075fcce3375 Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Thu, 9 Jun 2022 22:39:28 +0200 Subject: [PATCH] stage2: correctly work out dirname for ar --- src/link.zig | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/link.zig b/src/link.zig index 0aa5d0031d..51712db40e 100644 --- a/src/link.zig +++ b/src/link.zig @@ -797,9 +797,8 @@ pub const File = struct { } else { try base.flushModule(comp, prog_node); } - break :blk try fs.path.join(arena, &.{ - fs.path.dirname(full_out_path_z).?, base.intermediary_basename.?, - }); + const dirname = fs.path.dirname(full_out_path_z) orelse "."; + break :blk try fs.path.join(arena, &.{ dirname, base.intermediary_basename.? }); } else null; log.debug("module_obj_path={s}", .{if (module_obj_path) |s| s else "(null)"});