From e92f1bb271b6ca5ab714d2a21725b351f18c2369 Mon Sep 17 00:00:00 2001 From: battlmonstr Date: Wed, 1 Aug 2018 11:33:30 +0200 Subject: 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. --- src/nvim/os/lang.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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); -- cgit