Change the locale discovery procedure to treat empty string same as unset

This is explained in the commit message here:
f468f0b243
pull/140/head
Ran Benita 2017-08-13 18:06:04 +03:00
parent 3009ab422d
commit 76d9960dbe
1 changed files with 3 additions and 3 deletions

View File

@ -977,11 +977,11 @@ int main(int argc, char *argv[]) {
errx(EXIT_FAILURE, "Could not load keymap");
const char *locale = getenv("LC_ALL");
if (!locale)
if (!locale || !*locale)
locale = getenv("LC_CTYPE");
if (!locale)
if (!locale || !*locale)
locale = getenv("LANG");
if (!locale) {
if (!locale || !*locale) {
if (debug_mode)
fprintf(stderr, "Can't detect your locale, fallback to C\n");
locale = "C";