mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-15 14:56:13 +01:00
I broke locale sensitive ordering of date and month in
the long -l output format with the last commit. Fix it by replacing the "%b %e" strftime format with "%Ef". Make a note in the manual page that the LANG environment variable affects the running of ls. Reviewed by: ache
This commit is contained in:
parent
bdbfbf5ab9
commit
1e715e3437
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=61920
@ -392,6 +392,13 @@ The timezone to use when displaying dates.
|
||||
See
|
||||
.Xr environ 7
|
||||
for more information.
|
||||
.It Ev LANG
|
||||
The locale to use when determining the order of day and month in the long
|
||||
.Fl l
|
||||
format output.
|
||||
See
|
||||
.Xr environ 7
|
||||
for more information.
|
||||
.It LSCOLORS
|
||||
The value of this variable describes what color to use for which
|
||||
attribute when the color output
|
||||
|
@ -301,15 +301,18 @@ printtime(ftime)
|
||||
now = time(NULL);
|
||||
|
||||
#define SIXMONTHS ((365 / 2) * 86400)
|
||||
/* "%Ef" is a FreeBSD strftime definition for "%e %b" or "%b %e".
|
||||
* Actually format is locale sensitive.
|
||||
*/
|
||||
if (f_sectime)
|
||||
/* Mmm dd hh:mm:ss yyyy */
|
||||
format = "%b %e %T %Y ";
|
||||
/* mmm dd hh:mm:ss yyyy || dd mmm hh:mm:ss yyyy */
|
||||
format = "%Ef %T %Y ";
|
||||
else if (ftime + SIXMONTHS > now && ftime < now + SIXMONTHS)
|
||||
/* Mmm dd hh:mm */
|
||||
format = "%b %e %R ";
|
||||
/* mmm dd hh:mm || dd mmm hh:mm */
|
||||
format = "%Ef %R ";
|
||||
else
|
||||
/* Mmm dd yyyy */
|
||||
format = "%b %e %Y ";
|
||||
/* mmm dd yyyy || dd mmm yyyy */
|
||||
format = "%Ef %Y ";
|
||||
strftime(longstring, sizeof(longstring), format, localtime(&ftime));
|
||||
fputs(longstring, stdout);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user