refactor(macos-system): use new Environ method

This commit is contained in:
utox39
2026-02-11 18:33:41 +01:00
parent 51f6ddc2d1
commit 525156f4c6

View File

@@ -25,8 +25,8 @@ pub fn getHostname(allocator: std.mem.Allocator) ![]u8 {
return hostname; return hostname;
} }
pub fn getLocale(allocator: std.mem.Allocator) ![]u8 { pub fn getLocale(allocator: std.mem.Allocator, environ: std.process.Environ) ![]u8 {
const locale = std.process.getEnvVarOwned(allocator, "LANG") catch |err| if (err == error.EnvironmentVariableNotFound) { const locale = std.process.Environ.getAlloc(environ, allocator, "LANG") catch |err| if (err == error.EnvironmentVariableNotFound) {
return allocator.dupe(u8, "Unknown"); return allocator.dupe(u8, "Unknown");
} else return err; } else return err;
return locale; return locale;