w(1): Limit affect of locale change
authorJohn Marino <draco@marino.st>
Tue, 8 Dec 2015 21:40:03 +0000 (22:40 +0100)
committerJohn Marino <draco@marino.st>
Tue, 8 Dec 2015 21:51:55 +0000 (22:51 +0100)
commitef2687d455a182ac4297be77c0432959bc6e1127
treee670a3f66d13c946c45da1906a97751ddc15b42e
parent65d9d14f4bbb4e9ad39051e7473158f24064b319
w(1): Limit affect of locale change

In essence, w(1) is not designed to be locale sensitive.  The majority
of the outputted text is exclusively English.  However, it does check
the locale for the AM/PM setting (12 hour vs 24 hour clock) and the
decimal separator.

Given that w(1) is designed for English, it only provides enough space
to accommodate "AM" or "PM".  When other locales are used
(e.g. de_DE.UTF-8) the output is simply truncated and confusing.

Let's keep the 12-hour clock labels in the same language as the rest
of the program by forcing strftime to use the C/POSIX locale.  Using
locales still affects am/pm presence and the decimal separator as
originally intended.
usr.bin/w/pr_time.c
usr.bin/w/w.c