summaryrefslogtreecommitdiff
path: root/i3status.c
diff options
context:
space:
mode:
authorMichael Stapelberg <michael@stapelberg.de>2011-06-30 19:55:04 +0200
committerMichael Stapelberg <michael@stapelberg.de>2011-06-30 19:55:04 +0200
commit8bcb4e5c17b21d48d9ea1e606255f8d83a529752 (patch)
tree577ec738b89fee74e33f8915bba07cd1dd4db7e6 /i3status.c
parentabd1c58d7e95155da1d8d8487516662add2efe95 (diff)
Bugfix: call setlocale() to make %c work in the date format (Thanks loz)
Diffstat (limited to 'i3status.c')
-rw-r--r--i3status.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/i3status.c b/i3status.c
index ebef513..372e53a 100644
--- a/i3status.c
+++ b/i3status.c
@@ -26,6 +26,7 @@
#include <sys/types.h>
#include <time.h>
#include <sys/time.h>
+#include <locale.h>
#include "i3status.h"
@@ -283,6 +284,9 @@ int main(int argc, char *argv[]) {
action.sa_handler = sigpipe;
sigaction(SIGPIPE, &action, NULL);
+ if (setlocale(LC_ALL, "") == NULL)
+ die("Could not set locale. Please make sure all your LC_* / LANG settings are correct.");
+
while ((o = getopt_long(argc, argv, "c:hv", long_options, &option_index)) != -1)
if ((char)o == 'c')
configfile = optarg;