diff options
author | Leah Neukirchen <leah@vuxu.org> | 2017-07-19 13:25:10 +0200 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2017-07-19 13:25:10 +0200 |
commit | 4bdec3f2e9025964ab810f832ff768fa32c1e173 (patch) | |
tree | dfecd943584f37aeb361c3808fc0acdd1da898ef /lr.c | |
parent | 1aea20cbc7f919fcc42d7b67c2ae609d6c33a0d9 (diff) | |
download | lr-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.
Diffstat (limited to 'lr.c')
-rw-r--r-- | lr.c | 3 |
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; |