diff --git a/mdl/m_datetime.pas b/mdl/m_datetime.pas index 6609c0b..b81690c 100644 --- a/mdl/m_datetime.pas +++ b/mdl/m_datetime.pas @@ -292,25 +292,17 @@ End; Function DayOfWeek (Date: LongInt) : Byte; Var - Offset : Byte; - DT : DateTime; + DT : DateTime; + Res : LongInt; Begin UnpackTime (Date, DT); - If DT.Month > 2 Then Offset := 0 Else Offset := 1; + If DT.Month < 3 Then + Res := 365 * DT.Year + DT.Day + 31 * (DT.Month - 1) + Trunc ((DT.Year - 1) / 4) - Trunc(0.75 * Trunc((DT.Year - 1) / 100) + 1) + Else + Res := 365 * DT.Year + DT.Day + 31 * (DT.Month - 1) - Trunc (0.4 * DT.Month + 2.3) + Trunc (DT.Year / 4) - Trunc (0.75 * Trunc (DT.Year / 100) + 1); - Result := (((3 * (DT.Year) - (7 * ((DT.Year) + ((DT.Month) + 9) DIV 12)) - DIV 4 + (23 * (DT.Month)) DIV 9 + (DT.Day) + 2 + (((DT.Year) - - Offset) DIV 100 + 1) * 3 DIV 4 - 16) MOD 7)); -(* - IF m < 3 THEN - F := 365 * y + d + 31 * (m - 1) + trunc ((y - 1) / 4) - - trunc (0.75 * trunc ((y - 1) / 100) + 1) - ELSE - f := 365 * y + d + 31 * (m - 1) - trunc (0.4 * m + 2.3) + - trunc (y / 4) - trunc (0.75 * trunc (y / 100) + 1); - tot := f MOD 7; -*) + Result := Res MOD 7; End; Function DaysAgo (Date: LongInt) : LongInt; diff --git a/mdl/m_io_sockets.pas b/mdl/m_io_sockets.pas index 9ae3b42..77fbcf2 100644 --- a/mdl/m_io_sockets.pas +++ b/mdl/m_io_sockets.pas @@ -154,7 +154,7 @@ Begin FInBufEnd := 0; FOutBufPos := 0; FTelnetState := 0; - FTelnetEcho := False; + FTelnetEcho := True; FTelnetClient := False; FTelnetServer := False; FDisconnect := True; @@ -395,7 +395,7 @@ Begin End; If Buf[Count] = Telnet_Echo Then - FTelnetEcho := True; + FTelnetEcho := False; End; End; End; diff --git a/mdl/m_pipe.pas b/mdl/m_pipe.pas index 0700c87..92c3c67 100644 --- a/mdl/m_pipe.pas +++ b/mdl/m_pipe.pas @@ -5,8 +5,8 @@ Unit m_Pipe; Interface {$IFDEF UNIX} - Uses m_Pipe_Unix; - Type TPipe = Class(TPipeUnix); + Uses m_Pipe_Disk; + Type TPipe = Class(TPipeDisk); {$ENDIF} {$IFDEF WINDOWS} @@ -21,4 +21,4 @@ Interface Implementation -End. \ No newline at end of file +End. diff --git a/mdl/m_strings.pas b/mdl/m_strings.pas index 04b1166..ee46bd0 100644 --- a/mdl/m_strings.pas +++ b/mdl/m_strings.pas @@ -352,7 +352,9 @@ Begin Result := Str[1]; If Pos(' ', Str) > 0 Then - Result := Result + Str[Succ(Pos(' ', Str))]; + Result := Result + Str[Succ(Pos(' ', Str))] + Else + Result := Result + Str[2]; End; Function strWrap (Var Str1, Str2: String; WrapPos: Byte) : Byte; diff --git a/mdl/m_term_ansi.pas b/mdl/m_term_ansi.pas index 2fcf03d..0b1c8a8 100644 --- a/mdl/m_term_ansi.pas +++ b/mdl/m_term_ansi.pas @@ -91,10 +91,15 @@ Var Y : Byte; Begin Y := ParseNumber; + If Y = 0 Then Y := 1; + X := ParseNumber; + If X = 0 Then X := 1; + Screen.CursorXY (X, Y); + ResetState; End; @@ -201,10 +206,12 @@ Begin 'm' : Begin If Length(Options) = 0 Then Begin Screen.TextAttr := 7; + ResetState; End Else While Length(Options) > 0 Do Begin Temp := ParseNumber; + Case Temp of 0 : Screen.TextAttr := 7; 1 : Screen.TextAttr := Screen.TextAttr OR $08; @@ -219,20 +226,24 @@ Begin 47: Screen.TextAttr := (Screen.TextAttr AND $F + ColorTable[Temp]); End; End; + ResetState; End; 'n' : Begin If Client <> NIL Then Client.WriteStr(#27 + '[' + strI2S(Screen.CursorY) + ';' + strI2S(Screen.CursorX) + 'R'); + ResetState; End; 's' : Begin SavedX := Screen.CursorX; SavedY := Screen.CursorY; + ResetState; End; 'u' : Begin Screen.CursorXY (SavedX, SavedY); + ResetState; End; Else @@ -254,6 +265,7 @@ Begin #12 : Screen.ClearScreen; Else Screen.WriteChar(Ch); + State := 0; WasValid := True; End;