]> git.sur5r.net Git - i3/i3lock/commitdiff
Merge pull request #140 from bluetech/fix-locale-discovery
authorIngo Bürk <admin@airblader.de>
Sun, 13 Aug 2017 15:25:25 +0000 (17:25 +0200)
committerGitHub <noreply@github.com>
Sun, 13 Aug 2017 15:25:25 +0000 (17:25 +0200)
Change the locale discovery procedure to treat empty string same as unset

i3lock.c

index 87a77b1d004270a73ba74595765300716437bb6b..208e4acba4ae5533d37b7bf7d5371ccef248923c 100644 (file)
--- a/i3lock.c
+++ b/i3lock.c
@@ -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";