Page MenuHomeFreeBSD

ps(1): Move 'width' field from VAR to VARENT; Remove sizevars()
ClosedPublic

Authored by olce on Apr 1 2025, 1:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 28, 1:15 PM
Unknown Object (File)
Tue, Apr 22, 6:22 AM
Unknown Object (File)
Mon, Apr 14, 6:22 PM
Unknown Object (File)
Apr 12 2025, 12:58 PM
Unknown Object (File)
Apr 5 2025, 1:27 PM
Unknown Object (File)
Apr 4 2025, 5:11 AM
Unknown Object (File)
Apr 4 2025, 4:33 AM
Unknown Object (File)
Apr 3 2025, 1:44 PM
Subscribers

Details

Summary

Some column's width depends not only on the information displayed but
also on the its header, which may have been customized. Consequently,
that width is a property of the actual column and should not be attached
to the keyword specifying which information to print.

This change fixes a bug where multiple columns displaying the same
information (same keyword) but with different headers would have the
same width, although they should not if they have long enough headers
that have different lengths (the width computed from the largest header
would be applied to all the corresponding keyword's columns).

Remove sizevars(), as the 'width' field is now initialized directly in
parsefmt(), which creates the VARENT structures.

While here, remove var[]'s sentinel line, and consequently adjust the
upper limit in showkey()'s loop and findvar()'s binary search.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable