HomeFreeBSD

MFC r351379 r351385 r351592:

Description

MFC r351379 r351385 r351592:

Change w(1) to compute FROM (host) field size dynamically

It's nice to be able to display a full IPv6 host address if
needed, but it's also nice to display more than 3 characters of a command
line. Compute the needed size for the FROM column in an earlier pass,
and determine the maximum, then print what fits for the command.

Fix address annotation in xml output from w

The libxo xml feature of adding an annotation with the "original"
address from the utmpx file if it is different than the final "from"
field was broken by r351379. This was pointed out by the gcc error
that save_p might be used uninitialized. Save the original address
as needed in each entry, don't just use the last one from the previous
loop.

Reviewed by: marcel@
Differential Revision: https://reviews.freebsd.org/D21211
Differential Revision: https://reviews.freebsd.org/D21390