diff --git a/mdl/m_io_base.pas b/mdl/m_io_base.pas index aa304c7..ff88255 100644 --- a/mdl/m_io_base.pas +++ b/mdl/m_io_base.pas @@ -19,7 +19,7 @@ Type Constructor Create; Virtual; Destructor Destroy; Override; - Procedure PurgeInputData; + Procedure PurgeInputData (Drain: Boolean); Procedure PurgeOutputData; Function DataWaiting : Boolean; Virtual; Function WriteBuf (Var Buf; Len: LongInt) : LongInt; Virtual; @@ -56,15 +56,16 @@ Begin FOutBufPos := 0; End; -Procedure TIOBase.PurgeInputData; -//Var -// Buf : Array[1..2048] of Char; +Procedure TIOBase.PurgeInputData (Drain: Boolean); +Var + Buf : Array[1..2048] of Char; Begin FInBufPos := 0; FInBufEnd := 0; -// While DataWaiting Do -// ReadBuf(Buf, SizeOf(Buf)); + If Drain Then + While DataWaiting Do + ReadBuf(Buf, SizeOf(Buf)); End; Function TIOBase.DataWaiting : Boolean; diff --git a/mdl/m_pipe.pas b/mdl/m_pipe.pas index 92c3c67..5a87812 100644 --- a/mdl/m_pipe.pas +++ b/mdl/m_pipe.pas @@ -10,8 +10,8 @@ Interface {$ENDIF} {$IFDEF WINDOWS} - Uses m_Pipe_Disk; - Type TPipe = Class(TPipeDisk); + Uses m_Pipe_Windows; + Type TPipe = Class(TPipeWindows); {$ENDIF} {$IFDEF OS2} diff --git a/mdl/m_pipe_disk.pas b/mdl/m_pipe_disk.pas index 61e5c7d..3f5e49b 100644 --- a/mdl/m_pipe_disk.pas +++ b/mdl/m_pipe_disk.pas @@ -39,7 +39,7 @@ Type // General functions Procedure DeleteFiles; Procedure SendToPipe (Var Buf; Len: Longint); - Procedure ReadFromPipe (Var Buf; Len: LongInt; Var bRead: LongInt); + Procedure ReadFromPipe (Var Buf; Len: LongInt; Var bRead: LongWord); Procedure Disconnect; End; @@ -125,7 +125,7 @@ Begin BlockWrite (PipeOutput, Buf, Len, bWrite); End; -Procedure TPipeDisk.ReadFromPipe (Var Buf; Len: LongInt; Var bRead: LongInt); +Procedure TPipeDisk.ReadFromPipe (Var Buf; Len: LongInt; Var bRead: LongWord); Var Buffer : TPipeDiskBuffer Absolute Buf; Ch : Char; diff --git a/mdl/m_protocol_zmodem.pas b/mdl/m_protocol_zmodem.pas index 0191ba3..482475d 100644 --- a/mdl/m_protocol_zmodem.pas +++ b/mdl/m_protocol_zmodem.pas @@ -1774,7 +1774,7 @@ Begin {$IFDEF ZDEBUG} ZLog('DoAbortSequence -> begin'); {$ENDIF} - Client.PurgeInputData; + Client.PurgeInputData(False); Client.PurgeOutputData; Client.BufWriteStr(Attn); diff --git a/mdl/m_strings.pas b/mdl/m_strings.pas index ee46bd0..e10aa1a 100644 --- a/mdl/m_strings.pas +++ b/mdl/m_strings.pas @@ -17,6 +17,7 @@ Function strH2I (Str: String) : LongInt; Function strI2H (Num: LongInt) : String; Function strS2I (Str: String) : LongInt; Function strI2O (Num: LongInt) : String; +Function strR2S (Num: Real; Deci: Byte) : String; Function strWordGet (Num: Byte; Str: String; Ch: Char) : String; Function strWordPos (Num: Byte; Str: String; Ch: Char) : Byte; Function strWordCount (Str: String; Ch: Char) : Byte; @@ -205,6 +206,11 @@ Begin Str(Num, Result); End; +Function strR2S (Num: Real; Deci: Byte) : String; +Begin + Str (Num:0:Deci, Result); +End; + Function strS2I (Str: String) : LongInt; Var Res : LongInt;