From 41316ef5a645ba9aa713c48b437a1c9ed931fdcc Mon Sep 17 00:00:00 2001 From: mysticbbs Date: Mon, 5 Aug 2013 12:51:08 -0400 Subject: [PATCH] A36 --- mdl/m_io_sockets.pas | 34 +++++++++++++++++++++++++++++++++- mdl/m_ops.pas | 5 +++++ mdl/m_output_scrollback.pas | 5 ++++- 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/mdl/m_io_sockets.pas b/mdl/m_io_sockets.pas index 271accd..93fc694 100644 --- a/mdl/m_io_sockets.pas +++ b/mdl/m_io_sockets.pas @@ -51,7 +51,7 @@ Type Procedure BufWriteStr (Str: String); Override; Function WriteLine (Str: String) : LongInt; Override; Function WriteStr (Str: String) : LongInt; Override; - Function WriteFile (Str: String) : Boolean; + Function WriteFile (Prefix, FileName: String) : Boolean; Function WriteBufEscaped (Var Buf: TIOBuffer; Var Len: LongInt) : LongInt; Procedure TelnetInBuffer (Var Buf: TIOBuffer; Var Len: LongInt); Function ReadBuf (Var Buf; Len: LongInt) : LongInt; Override; @@ -228,6 +228,37 @@ Begin Result := fpSend(FSocketHandle, @Str[1], Length(Str), FPSENDOPT); End; +Function TIOSocket.WriteFile (Prefix, FileName: String) : Boolean; +Var + T : Text; + S : String; +Begin + Result := False; + FileMode := 66; + + Assign (T, FileName); + Reset (T); + + If IoResult <> 0 Then Exit; + + While Not Eof(T) Do Begin + ReadLn (T, S); + + If Prefix <> '' Then + If EOF(T) Then + S := Prefix + ' ' + S + Else + S := Prefix + '- ' + S; + + WriteLine(S); + End; + + Close (T); + + Result := True; +End; + +(* Function TIOSocket.WriteFile (Str: String) : Boolean; Var Buf : Array[1..4096] of Char; @@ -255,6 +286,7 @@ Begin Result := True; End; +*) Function TIOSocket.WriteBufEscaped (Var Buf: TIOBuffer; Var Len: LongInt) : LongInt; Var diff --git a/mdl/m_ops.pas b/mdl/m_ops.pas index d19d9e2..3cc711a 100644 --- a/mdl/m_ops.pas +++ b/mdl/m_ops.pas @@ -21,6 +21,7 @@ $LINUX : Set if target OS is linux $WINDOWS : Set if target OS is windows $DARWIN : Set if target OS is Mac OSX + $OS2 : Set if target OS is OS2 FILE SYSTEMS: $FS_SENSITIVE : Set if target file system is case sensitive @@ -51,6 +52,10 @@ {$DEFINE FS_IGNORE} {$ENDIF} +{$IFDEF OS2} + {$DEFINE FS_IGNORE} +{$ENDIF} + { ------------------------------------------------------------------------- } {$MODE DELPHI} diff --git a/mdl/m_output_scrollback.pas b/mdl/m_output_scrollback.pas index 0133c01..972d9e5 100644 --- a/mdl/m_output_scrollback.pas +++ b/mdl/m_output_scrollback.pas @@ -75,8 +75,10 @@ Begin Result := True; For Count := 1 to 80 Do - If (Buffer[Line][Count].UnicodeChar <> #0) and ((Buffer[Line][Count].UnicodeChar <> ' ') and (Buffer[Line][Count].Attributes <> 7)) Then Begin +// If (Buffer[Line][Count].UnicodeChar <> #0) and ((Buffer[Line][Count].UnicodeChar <> ' ') and (Buffer[Line][Count].Attributes <> 7)) Then Begin + If (Buffer[Line][Count].UnicodeChar <> #0) and ((Buffer[Line][Count].UnicodeChar <> ' ') or (Buffer[Line][Count].Attributes <> 7)) Then Begin Result := False; + Exit; End; End; @@ -95,6 +97,7 @@ Begin While Line > 0 Do Begin If Not IsBlankLine(Line) Then Break; + Dec(Line); End;