]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
last(1): unbreak for 8-bit locales
authorEugene Grosbein <eugen@FreeBSD.org>
Fri, 23 Aug 2019 01:25:38 +0000 (01:25 +0000)
committerEugene Grosbein <eugen@FreeBSD.org>
Fri, 23 Aug 2019 01:25:38 +0000 (01:25 +0000)
commit8e67c427b5010179aa2c7e44ffab4e7511d93201
tree43f382b8901d51bcb5482867463f9177c6e60b62
parente1aa7047af0d91568e6de9beaca59cddf577453d
last(1): unbreak for 8-bit locales

Ouput format of last(1) is broken for non UTF-8 locales
since it got libxo(3) support. It uses strftime(3) that produces
non UTF-8 strings passed to xo_emit(3) with wrong %s format -
it should be %hs in this case, so xo_emit(3) produces empty output.

This change is basically no-op when locale is of UTF-8 type,
f.e. en_GB.UTF-8 or ru_RU.UTF-8 or sr_RS.UTF-8@latin.
It fixes output for other locales.

MFC after: 2 weeks
usr.bin/last/last.c