top: do not add an extra line when rcfile is rewritten

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.

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2022-03-15 00:00:00 -05:00 committed by Craig Small
parent 8269e18b3f
commit a03a09ae1e

View File

@ -5281,7 +5281,7 @@ static void write_rcfile (void) {
fprintf(fp, Osel_delim_2_txt);
}
if (Inspect.raw)
if (Inspect.raw && strcmp(Inspect.raw, "\n"))
fputs(Inspect.raw, fp);
fclose(fp);