From 3e32edf187f189ba6ca1425663a9f49b51edb1e9 Mon Sep 17 00:00:00 2001 From: ache Date: Wed, 21 Mar 2001 13:41:03 +0000 Subject: Use nl_langinfo instead of %Ef --- usr.sbin/ac/ac.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'usr.sbin/ac/ac.c') diff --git a/usr.sbin/ac/ac.c b/usr.sbin/ac/ac.c index 07d5bed..e6b0ae2 100644 --- a/usr.sbin/ac/ac.c +++ b/usr.sbin/ac/ac.c @@ -23,6 +23,7 @@ static const char rcsid[] = #include #include #include +#include #include #include #include @@ -322,9 +323,13 @@ show_today(users, logins, secs) struct utmp_list *lp; char date[64]; time_t yesterday = secs - 1; + static int d_first = -1; - (void)strftime(date, sizeof (date), "%Ef total", - localtime(&yesterday)); + if (d_first < 0) + d_first = (*nl_langinfo(D_MD_ORDER) == 'd'); + (void)strftime(date, sizeof (date), + d_first ? "%e %b total" : "%b %e total", + localtime(&yesterday)); /* restore the missing second */ yesterday++; -- cgit v1.1