diff options
Diffstat (limited to 'src/ShaderBuild.zig')
| -rw-r--r-- | src/ShaderBuild.zig | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/ShaderBuild.zig b/src/ShaderBuild.zig index c2610fd7..b50999a5 100644 --- a/src/ShaderBuild.zig +++ b/src/ShaderBuild.zig @@ -236,11 +236,9 @@ fn collect(b: *Build, gpa: std.mem.Allocator, core: *pardes.Pardes, job: *Job) v } } -/// `~/` is the home directory. -fn expand(buf: []u8, path: []const u8) []const u8 { - if (!std.mem.startsWith(u8, path, "~/")) return path; - const home = libc.getenv("HOME") orelse return path; - return std.fmt.bufPrint(buf, "{s}/{s}", .{ std.mem.span(home), path[2..] }) catch path; +/// `~` is the home directory (the one rule, filesystem.expandHome). +fn expand(buf: *[4096]u8, path: []const u8) []const u8 { + return pardes.filesystem.expandHome(path, buf); } /// The compile thread: each file behind the prefix, through glslc with the |
