init_lang(): properly invoke setlocale() for LANG

This commit is contained in:
nick black 2020-06-01 09:16:05 -04:00
parent e3c14ed569
commit 002f65fb54
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -690,7 +690,7 @@ init_banner(const notcurses* nc){
static void static void
init_lang(const notcurses_options* opts){ init_lang(const notcurses_options* opts){
if(!(opts->flags & NCOPTION_INHIBIT_SETLOCALE)){ if(!(opts->flags & NCOPTION_INHIBIT_SETLOCALE)){
const char* locale = setlocale(LC_ALL, NULL); const char* locale = setlocale(LC_ALL, "");
if(locale && (!strcmp(locale, "C") || !strcmp(locale, "POSIX"))){ if(locale && (!strcmp(locale, "C") || !strcmp(locale, "POSIX"))){
const char* lang = getenv("LANG"); const char* lang = getenv("LANG");
if(lang){ if(lang){