From: Mark D. <mar...@zn...> - 2007-06-21 03:02:05
|
Hi, It doesn't work as I expected on Win32. (but I might be expecting the wrong thing). Where in the READLINE routine you do: if( c == '\n' ) break; ++off; I think you need ++off; if( c == '\n' ) break; This, at least, makes it work for me. The way I read the code, currently the '\n' byte never gets returned which I assume is not what is intended. It works fine on my Linux box as it stands. So I suppose that if the byte '\n' is stripped off, the final byte in the stream that gets returned is always 'null' - which on Linux gets treated as end of string somewhere along the line, but on Win32 doesn't. Regards Mark Mattia Barbon wrote: > On Tue, 19 Jun 2007 21:39:29 +0100 > Mark Dootson <mar...@zn...> wrote: > >> Mattia Barbon wrote: >>> I do not agree with what you write above (note: I am not saying the current implementation is correct!) >>> what I think readline should do is work with bytes: >>> >>> read a char from the stream >>> add it to a charbuffer >>> if char == '\n' { >>> return the buffer as a byte string, without performing any conversion >>> } >>> >>> I believe that automatically interpreting program output based upon >>> wxWidgets ideas (which usually means using the current locale) will cause >>> trouble. Returning bytes leaves the interpretation to the calling program >>> which is always a safe choice. >> I think you are right. Bytes makes much more sense. > > Changed in Subversion. I tried it with Wx::Perl::ProcessStream 0.09 > and it works as I expect. Pleas let me know if it works for you too. > > Regards, > Mattia |