aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std/Build')
-rw-r--r--lib/std/Build/Cache.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/std/Build/Cache.zig b/lib/std/Build/Cache.zig
index bb36bb978f..1ad111f2e3 100644
--- a/lib/std/Build/Cache.zig
+++ b/lib/std/Build/Cache.zig
@@ -9,6 +9,13 @@ pub const Directory = struct {
path: ?[]const u8,
handle: fs.Dir,
+ pub fn clone(d: Directory, arena: Allocator) Allocator.Error!Directory {
+ return .{
+ .path = if (d.path) |p| try arena.dupe(u8, p) else null,
+ .handle = d.handle,
+ };
+ }
+
pub fn cwd() Directory {
return .{
.path = null,