]> granicus.if.org Git - procps-ng/commit
top: do not add an extra line when rewritting a rcfile
authorJim Warner <james.warner@comcast.net>
Thu, 17 Mar 2022 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@dropbear.xyz>
Mon, 21 Mar 2022 10:13:07 +0000 (21:13 +1100)
commit255383a8cd049f9c90fa234ba7d586be2bcde8d7
tree9f2af7ad94dc6e4e7185db2351ca01eeedc4f1bd
parent212de8cf8c9c656a25814d7ab046c52bad48cfd6
top: do not add an extra line when rewritting a rcfile

When the configuration file is first written, there is
just the normal single newline which ends that rcfile.

However, when any existing rcfile was rewritten, there
was one extra newline '\n' character added at the end.
This will happen just once. The file does NOT continue
to grow with the extra blank lines always being added.

Anyway, this patch will put an end to such a practice.

[ along the way i fixed an unrelated whitespace oops ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
top/top.c
top/top.h