aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbattlmonstr <battlmonstr@users.noreply.github.com>2018-08-01 11:33:30 +0200
committerbattlmonstr <battlmonstr@users.noreply.github.com>2018-08-01 12:00:13 +0200
commite92f1bb271b6ca5ab714d2a21725b351f18c2369 (patch)
treeb30505d4052d51e810033abead6821c0696ca7fe
parenta2253744c9bcd9229be9533540075e977f0be2cd (diff)
downloadrneovim-e92f1bb271b6ca5ab714d2a21725b351f18c2369.tar.gz
rneovim-e92f1bb271b6ca5ab714d2a21725b351f18c2369.tar.bz2
rneovim-e92f1bb271b6ca5ab714d2a21725b351f18c2369.zip
Fix crash in lang_init() on macOS if lang_region = NULL
This is a regression after PR #7704: mac: Set $LANG based on the system locale CFStringGetCStringPtr sometimes returns "lang_region" = NULL, in this case CFStringGetCString is used instead, which places output to "buf", but "buf" was not used by the code.
-rw-r--r--src/nvim/os/lang.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/os/lang.c b/src/nvim/os/lang.c
index 47c278ee97..6b2a54ddbe 100644
--- a/src/nvim/os/lang.c
+++ b/src/nvim/os/lang.c
@@ -31,7 +31,7 @@ void lang_init(void)
char buf[20] = { 0 };
if (CFStringGetCString(cf_lang_region, buf, 20,
kCFStringEncodingUTF8)) {
- os_setenv("LANG", lang_region, true);
+ os_setenv("LANG", buf, true);
}
}
CFRelease(cf_lang_region);