Use nl_langinfo instead of %Ef

This commit is contained in:
Andrey A. Chernov 2001-03-21 14:32:02 +00:00
parent 9b399f7ec9
commit 77b898c43a
2 changed files with 7 additions and 2 deletions

View File

@ -53,6 +53,7 @@ static char sccsid[] = "@(#)pr.c 8.2 (Berkeley) 4/16/94";
#include <ctype.h>
#include <errno.h>
#include <langinfo.h>
#include <locale.h>
#include <signal.h>
#include <stdio.h>
@ -1577,6 +1578,7 @@ setup(argc, argv)
register char **argv;
{
register int c;
int d_first;
int eflag = 0;
int iflag = 0;
int wflag = 0;
@ -1818,8 +1820,10 @@ setup(argc, argv)
}
}
timefrmt = TIMEFMT;
(void) setlocale(LC_TIME, (Lflag != NULL) ? Lflag : "");
d_first = (*nl_langinfo(D_MD_ORDER) == 'd');
timefrmt = d_first ? TIMEFMTD : TIMEFMTM;
return(0);
}

View File

@ -59,7 +59,8 @@
#define HDFMT "%s %s Page %d\n\n\n"
#define HEADLEN 5
#define TAILLEN 5
#define TIMEFMT "%Ef %H:%M %Y"
#define TIMEFMTD "%e %b %H:%M %Y"
#define TIMEFMTM "%b %e %H:%M %Y"
#define FNAME ""
#define LBUF 8192
#define HDBUF 512