]> git.ipfire.org Git - thirdparty/util-linux.git/commit
swapon: Keep headings and fields aligned in summary output.
authorSebastian Rasmussen <sebras@gmail.com>
Sun, 18 Apr 2021 01:41:50 +0000 (03:41 +0200)
committerSebastian Rasmussen <sebras@gmail.com>
Sun, 18 Apr 2021 01:48:57 +0000 (03:48 +0200)
commit5fba3d7b4e1d6c47ef3c96301541ea290b452d7b
tree903fa276a27b0b235b3a8e2aa30392015c989f59
parent1c75a85101e36ebc193183733821546f0fa430fc
swapon: Keep headings and fields aligned in summary output.

Because the headings are aligned with tabs the fields must
always be a multiple of 8 characters. Moreover if the field
values are shorter than 8 characters, extra tabs must be
inserted before the succeding field to keep alignment.

swapon parses /proc/swaps, generated by the Linux kernel in
mm/swapfile.c. Its function swap_show() and its recent fix in
commit 6f7939405f61de7d0da7f6c90182e96c4f5ff6c1 were used as
inspiration for this commit.

Additionally inform the translators about the requirements of
formatting and relationship between the heading and entry strings.
sys-utils/swapon.c