summaryrefslogtreecommitdiffstats
path: root/usr.bin/ncal
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2001-03-21 14:24:05 +0000
committerache <ache@FreeBSD.org>2001-03-21 14:24:05 +0000
commita94919d09789b67143521de9203a4a241463357f (patch)
treef5de7bdd92f763f748122a55fc5b519bd12e5201 /usr.bin/ncal
parent0a943ba92b8f759e2a8b70bde936bb1e2605eb75 (diff)
downloadFreeBSD-src-a94919d09789b67143521de9203a4a241463357f.zip
FreeBSD-src-a94919d09789b67143521de9203a4a241463357f.tar.gz
Use nl_langinfo instead of %EF
Diffstat (limited to 'usr.bin/ncal')
-rw-r--r--usr.bin/ncal/ncal.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/ncal/ncal.c b/usr.bin/ncal/ncal.c
index 14bfdd8..fcae694 100644
--- a/usr.bin/ncal/ncal.c
+++ b/usr.bin/ncal/ncal.c
@@ -31,6 +31,7 @@ static const char rcsid[] =
#include <calendar.h>
#include <err.h>
+#include <langinfo.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
@@ -370,7 +371,10 @@ printeaster(int y, int julian, int orthodox)
date dt;
struct tm tm;
char buf[80];
+ static int d_first = -1;
+ if (d_first < 0)
+ d_first = (*nl_langinfo(D_MD_ORDER) == 'd');
/* force orthodox easter for years before 1583 */
if (y < 1583)
orthodox = 1;
@@ -387,7 +391,7 @@ printeaster(int y, int julian, int orthodox)
tm.tm_year = dt.y - 1900;
tm.tm_mon = dt.m - 1;
tm.tm_mday = dt.d;
- strftime(buf, sizeof(buf), "%EF %Y", &tm);
+ strftime(buf, sizeof(buf), d_first ? "%e %B %Y" : "%B %e %Y", &tm);
printf("%s\n", buf);
}
OpenPOWER on IntegriCloud