]> git.sur5r.net Git - i3/i3lock/commitdiff
Change the locale discovery procedure to treat empty string same as unset 140/head
authorRan Benita <ran234@gmail.com>
Sun, 13 Aug 2017 15:06:04 +0000 (18:06 +0300)
committerRan Benita <ran234@gmail.com>
Sun, 13 Aug 2017 15:08:39 +0000 (18:08 +0300)
This is explained in the commit message here:
https://github.com/xkbcommon/libxkbcommon/commit/f468f0b2430e15cc262c5745445580bd0dc64ef0

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");
         errx(EXIT_FAILURE, "Could not load keymap");
 
     const char *locale = getenv("LC_ALL");
-    if (!locale)
+    if (!locale || !*locale)
         locale = getenv("LC_CTYPE");
         locale = getenv("LC_CTYPE");
-    if (!locale)
+    if (!locale || !*locale)
         locale = getenv("LANG");
         locale = getenv("LANG");
-    if (!locale) {
+    if (!locale || !*locale) {
         if (debug_mode)
             fprintf(stderr, "Can't detect your locale, fallback to C\n");
         locale = "C";
         if (debug_mode)
             fprintf(stderr, "Can't detect your locale, fallback to C\n");
         locale = "C";