aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2001-03-21 14:24:05 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2001-03-21 14:24:05 +0000
commitf5e40af22e91671648c48e95ed730356a7f1107e (patch)
tree7dbc2b01d19a397c82ef490b1e79c0d0a66608cc /usr.bin
parent50b4c62c47f402ef1011ebd1ccd3bddfd34bc0a0 (diff)
Notes
Diffstat (limited to 'usr.bin')
-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 14bfdd8acd25..fcae694504ac 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);
}