mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
Address feedback
This commit is contained in:
parent
6734271eb0
commit
62a6d83da1
@ -491,9 +491,21 @@ fn resolveSearchDir(
|
||||
) !?[]const u8 {
|
||||
var candidates = std.ArrayList([]const u8).init(arena);
|
||||
|
||||
if (!fs.path.isAbsolute(dir)) {
|
||||
if (fs.path.isAbsolute(dir)) {
|
||||
if (syslibroot) |root| {
|
||||
const full_path = try fs.path.join(arena, &[_][]const u8{ root, dir });
|
||||
const common_dir = if (std.Target.current.os.tag == .windows) blk: {
|
||||
// We need to check for disk designator and strip it out from dir path so
|
||||
// that we can concat dir with syslibroot.
|
||||
// TODO we should backport this mechanism to 'MachO.Dylib.parseDependentLibs()'
|
||||
const disk_designator = fs.path.diskDesignatorWindows(dir);
|
||||
|
||||
if (mem.indexOf(u8, dir, disk_designator)) |where| {
|
||||
break :blk dir[where + disk_designator.len ..];
|
||||
}
|
||||
|
||||
break :blk dir;
|
||||
} else dir;
|
||||
const full_path = try fs.path.join(arena, &[_][]const u8{ root, common_dir });
|
||||
try candidates.append(full_path);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user