PtyProcess superflous linebreaks (patch)

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Wed Nov 21 14:40:03 GMT 2007


On Wednesday 21 November 2007, Johannes Sixt wrote:
> Thomas Friedrichsmeier schrieb:
> > Another option would be to add a parameter "bool strip_linebreaks=true"
> > to readLines(), but I'm not clear on whether this sort of API change is
> > still acceptable. Ideas?
>
> Add a new (non-virtual, to stay BIC) function readLineOrPiece() that does
> not strip the new-line character?

For what it's worth, here's a patch that adds a "readAll()" function to 
KDESu::PtyProcess. This is then used in waitForChild() to correct the 
terminal output with respect to line breaks.

This patch tries to make sure to *preserve* the current behavior of 
readLine(), even that behavior may not be what the name suggests. It does add 
a few words of clarification to the API docs, however.

If somebody else would like to work on making readLine() do what the name 
suggests, I have no objections to that. But it's not the sort of change I'd 
personally feel comfortable with doing, at this point of the release process 
(I guess the kdesu libs is not heavily used, so it should be possible, but 
would definitely need good testing).

Regardless what happens to readLine(), though, I think having a readAll() 
function is definitely desirable. So - is it ok to commit the current patch?

Regards
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: process_readall.diff
Type: text/x-diff
Size: 4219 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071121/5ab1c698/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071121/5ab1c698/attachment.sig>


More information about the kde-core-devel mailing list