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;
|
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;
|
||||||
|
|||||||
Reference in New Issue
Block a user