mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-06 07:38:21 +00:00
windows: add trivial implementation of expandHome
This commit is contained in:
@@ -13,7 +13,7 @@ const Error = error{
|
||||
/// is generally an expensive process so the value should be cached.
|
||||
pub inline fn home(buf: []u8) !?[]const u8 {
|
||||
return switch (builtin.os.tag) {
|
||||
inline .linux, .freebsd, .macos => try homeUnix(buf),
|
||||
.linux, .freebsd, .macos => try homeUnix(buf),
|
||||
.windows => try homeWindows(buf),
|
||||
|
||||
// iOS doesn't have a user-writable home directory
|
||||
@@ -122,7 +122,13 @@ pub const ExpandError = error{
|
||||
pub fn expandHome(path: []const u8, buf: []u8) ExpandError![]const u8 {
|
||||
return switch (builtin.os.tag) {
|
||||
.linux, .freebsd, .macos => try expandHomeUnix(path, buf),
|
||||
|
||||
// `~/` is not an idiom generally used on Windows
|
||||
.windows => return path,
|
||||
|
||||
// iOS doesn't have a user-writable home directory
|
||||
.ios => return path,
|
||||
|
||||
else => @compileError("unimplemented"),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user