os: macos lang check should include lang null

This commit is contained in:
Mitchell Hashimoto
2023-11-05 15:46:05 -08:00
parent 74b840df8e
commit ea5ff77e29

View File

@ -21,12 +21,10 @@ pub fn ensureLocale(alloc: std.mem.Allocator) !void {
// process.
if (comptime builtin.target.isDarwin()) {
// Set the lang if it is not set or if its empty.
if (lang) |l| {
if (l.value.len == 0) {
if (lang == null or lang.?.value.len == 0) {
setLangFromCocoa();
}
}
}
// Set the locale to whatever is set in env vars.
if (setlocale(LC_ALL, "")) |v| {