mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-27 13:32:45 +00:00
Use nl_langinfo instead of %Ef
This commit is contained in:
parent
9b399f7ec9
commit
77b898c43a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=74575
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user