diff options
author | Stefan Eßer <se@FreeBSD.org> | 2020-11-03 12:15:08 +0000 |
---|---|---|
committer | Stefan Eßer <se@FreeBSD.org> | 2020-11-03 12:15:08 +0000 |
commit | f1560bd080a34d25fddd917e20363d32059459de (patch) | |
tree | 6fa1cd5094b1fc76bdeca9299c915f955d5e3daa | |
parent | cc9fbfafbe6bc8ec848c40cd5bb3887529329bb9 (diff) | |
download | src-f1560bd080a.tar.gz src-f1560bd080a.zip |
Consistently print calendar dates in the locale of the user
Calendar files that specify LANG=... to specify their character encoding did
also set the date format defined for that locale, resulting in output like:
Nov 4 Gabriel Faure dies from pneumonia in Paris, France, 1924
4 nov. N'oubliez pas les Charles !
After this commit the output is always printed in a consistent format
according to the user's current locale, e.g.:
Nov 4 Gabriel Faure dies from pneumonia in Paris, France, 1924
Nov 4 N'oubliez pas les Charles !
I'll open a review asking for opinions whether this format change should
be merged to -STABLE.
Relnotes: yes
Notes
Notes:
svn path=/head/; revision=367293
-rw-r--r-- | usr.bin/calendar/io.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/usr.bin/calendar/io.c b/usr.bin/calendar/io.c index be5d232bcd62..27bd55db3619 100644 --- a/usr.bin/calendar/io.c +++ b/usr.bin/calendar/io.c @@ -468,8 +468,7 @@ cal_parse(FILE *in, FILE *out) * and does not run iconv(), this variable has little use. */ if (strncmp(buf, "LANG=", 5) == 0) { - (void)setlocale(LC_ALL, buf + 5); - d_first = (*nl_langinfo(D_MD_ORDER) == 'd'); + (void)setlocale(LC_CTYPE, buf + 5); #ifdef WITH_ICONV if (!doall) set_new_encoding(); |