mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-27 19:09:47 +03:00
std.fs.path: make relative a pure function
Instead of querying the operating system for current working directory and environment variables, this function now accepts those things as inputs.
This commit is contained in:
+1
-2
@@ -1738,8 +1738,7 @@ pub fn pathFromRoot(b: *Build, sub_path: []const u8) []u8 {
|
||||
}
|
||||
|
||||
fn pathFromCwd(b: *Build, sub_path: []const u8) []u8 {
|
||||
const cwd = process.getCwdAlloc(b.allocator) catch @panic("OOM");
|
||||
return b.pathResolve(&.{ cwd, sub_path });
|
||||
return b.pathResolve(&.{ b.graph.cache.cwd, sub_path });
|
||||
}
|
||||
|
||||
pub fn pathJoin(b: *Build, paths: []const []const u8) []u8 {
|
||||
|
||||
Reference in New Issue
Block a user