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, Sep 29, 5:21 AM
Unknown Object (File)
Sep 5 2025, 3:35 PM
Unknown Object (File)
Sep 2 2025, 7:41 PM
Unknown Object (File)
Sep 2 2025, 3:21 PM
Unknown Object (File)
Aug 29 2025, 8:46 PM
Unknown Object (File)
Aug 16 2025, 1:49 PM
Unknown Object (File)
Aug 15 2025, 12:01 AM
Unknown Object (File)
Aug 14 2025, 1:05 AM
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