]> git.sur5r.net Git - i3/i3lock/commitdiff
Merge pull request #135 from grandchild/fix_optind_overwrite
authorIngo Bürk <admin@airblader.de>
Sun, 13 Aug 2017 15:26:38 +0000 (17:26 +0200)
committerGitHub <noreply@github.com>
Sun, 13 Aug 2017 15:26:38 +0000 (17:26 +0200)
Fix shadowing of getopt optind

Makefile
i3lock.c

index 8470e0942c6ca798956a0d6e44516d939f050c55..e1b6e43e923c72c072ba77b3aff5e66b3982c273 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,6 @@ CFLAGS += -Wall
 CPPFLAGS += -D_GNU_SOURCE
 CFLAGS += $(shell $(PKG_CONFIG) --cflags cairo xcb-xinerama xcb-atom xcb-image xcb-xkb xkbcommon xkbcommon-x11)
 LIBS += $(shell $(PKG_CONFIG) --libs cairo xcb-xinerama xcb-atom xcb-image xcb-xkb xkbcommon xkbcommon-x11)
-LIBS += -lpam
 LIBS += -lev
 LIBS += -lm
 
index af678aa7abdd46cf23219f71f9554d5afad172ae..945be9fa1cc4c5a8fb794c733a5a4edb2909fe8f 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";