thanks,
remains the question, which one of the two fixes is better.
arguably the added newline produces nicer output, supporting the current expectation that each readline->write starts at the beginning of the line, but writing something without a newline in the end is usually intentional, so adding a newline would break that.
currently it is not possible to write something without a newline because it would be overwritten, so this is only talking about future applications.
consider hilfe: with a newline the results of this:
write("foo");
foo (1) Result: 3
write("foo\n");
foo (1) Result: 4 would be indistinguishable (except for the value write returns)
with removing the clear it would instead be:
write("foo");
foo(1) Result: 3
this may be considered ugly but would somehow be more correct.
note that once a choice for either patch is made, it can't be changed without introducing compatibility issues.
greetings, martin.