Bugfix: call setlocale() to make %c work in the date format (Thanks loz)
This commit is contained in:
parent
abd1c58d7e
commit
8bcb4e5c17
@ -26,6 +26,7 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
#include <locale.h>
|
||||||
|
|
||||||
#include "i3status.h"
|
#include "i3status.h"
|
||||||
|
|
||||||
@ -283,6 +284,9 @@ int main(int argc, char *argv[]) {
|
|||||||
action.sa_handler = sigpipe;
|
action.sa_handler = sigpipe;
|
||||||
sigaction(SIGPIPE, &action, NULL);
|
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)
|
while ((o = getopt_long(argc, argv, "c:hv", long_options, &option_index)) != -1)
|
||||||
if ((char)o == 'c')
|
if ((char)o == 'c')
|
||||||
configfile = optarg;
|
configfile |