refactor(macos-system): use new Environ method
This commit is contained in:
@@ -25,8 +25,8 @@ pub fn getHostname(allocator: std.mem.Allocator) ![]u8 {
|
||||
return hostname;
|
||||
}
|
||||
|
||||
pub fn getLocale(allocator: std.mem.Allocator) ![]u8 {
|
||||
const locale = std.process.getEnvVarOwned(allocator, "LANG") catch |err| if (err == error.EnvironmentVariableNotFound) {
|
||||
pub fn getLocale(allocator: std.mem.Allocator, environ: std.process.Environ) ![]u8 {
|
||||
const locale = std.process.Environ.getAlloc(environ, allocator, "LANG") catch |err| if (err == error.EnvironmentVariableNotFound) {
|
||||
return allocator.dupe(u8, "Unknown");
|
||||
} else return err;
|
||||
return locale;
|
||||
|
||||
Reference in New Issue
Block a user