From 29b90c351fac831d7f82952decec89035d01ad37 Mon Sep 17 00:00:00 2001 From: mysticbbs Date: Fri, 22 Feb 2013 20:47:09 -0500 Subject: [PATCH] Extra precaution while redirecting STDIO in unix --- mystic/mis_client_telnet.pas | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mystic/mis_client_telnet.pas b/mystic/mis_client_telnet.pas index 74137a8..7d85e92 100644 --- a/mystic/mis_client_telnet.pas +++ b/mystic/mis_client_telnet.pas @@ -135,12 +135,10 @@ Begin Proc.Execute; - While Proc.Running Do Begin + While Proc.Running Or (Proc.Output.NumBytesAvailable > 0) Do Begin If Proc.Output.NumBytesAvailable > 0 Then Begin - While Proc.Output.NumBytesAvailable > 0 Do Begin - bRead := Proc.Output.Read(Buffer, TIOBufferSize); - Client.WriteBufEscaped (Buffer, bRead); - End; + bRead := Proc.Output.Read(Buffer, TIOBufferSize); + Client.WriteBufEscaped (Buffer, bRead); End Else If Client.DataWaiting Then Begin bWrite := Client.ReadBuf(Buffer, TIOBufferSize);