summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-07-19 13:25:10 +0200
committerLeah Neukirchen <leah@vuxu.org>2017-07-19 13:25:10 +0200
commit4bdec3f2e9025964ab810f832ff768fa32c1e173 (patch)
treedfecd943584f37aeb361c3808fc0acdd1da898ef
parent1aea20cbc7f919fcc42d7b67c2ae609d6c33a0d9 (diff)
downloadlr-4bdec3f2e9025964ab810f832ff768fa32c1e173.tar.gz
lr-4bdec3f2e9025964ab810f832ff768fa32c1e173.tar.xz
lr-4bdec3f2e9025964ab810f832ff768fa32c1e173.zip
lr: use setlocale.
This will enable date stamp formatting for %A, %C, %T as known from date(1).
Note that LC_COLLATE and LC_CTYPE is not respected, as we continue to
use strcmp.

Closes #12.
-rw-r--r--lr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lr.c b/lr.c
index fbf0f8a..3277bed 100644
--- a/lr.c
+++ b/lr.c
@@ -45,6 +45,7 @@
 #include <fnmatch.h>
 #include <grp.h>
 #include <limits.h>
+#include <locale.h>
 #include <paths.h>
 #include <pwd.h>
 #include <regex.h>
@@ -1936,6 +1937,8 @@ main(int argc, char *argv[])
 	now = time(0);
 	status = 0;
 
+	setlocale(LC_ALL, "");
+
 	while ((c = getopt(argc, argv, "01AC:DFGHLQST:Udf:lho:st:x")) != -1)
 		switch(c) {
 		case '0': format = zero_format; input_delim = 0; Qflag++; break;