Merge pull request #8805 from niacat/getenv-fix

platform_unix: Check whether LANG is defined before using it.
This commit is contained in:
Twinaphex 2019-05-18 18:01:30 +02:00 committed by GitHub
commit 5f5a3fa6a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2537,7 +2537,10 @@ enum retro_language frontend_unix_get_user_language(void)
}
}
#else
lang = rarch_get_language_from_iso(getenv("LANG"));
char *envvar = getenv("LANG");
if (envvar != NULL)
lang = rarch_get_language_from_iso(envvar);
#endif
#endif
return lang;