From aaf4d2fa6b35d9e89fd5a941d09d255c406e5008 Mon Sep 17 00:00:00 2001 From: paweld Date: Wed, 1 May 2024 08:20:59 +0200 Subject: [PATCH] =?UTF-8?q?`LF`=20support=20in=20the=20`Sz=C3=A9kely=20Bal?= =?UTF-8?q?=C3=A1zs`=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entries/sbalazs/src/uweatherstations.pas | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/entries/sbalazs/src/uweatherstations.pas b/entries/sbalazs/src/uweatherstations.pas index a01df4f..9a19d25 100644 --- a/entries/sbalazs/src/uweatherstations.pas +++ b/entries/sbalazs/src/uweatherstations.pas @@ -4,6 +4,8 @@ {$R-} {$Q-} {$INLINE ON} +{$define LFONLY} + interface uses @@ -314,7 +316,9 @@ procedure TWSThread.ProcessBytes(ABytes: TBytes); Temp := Temp*10 + Ord(ABytes[PCur]) - Ord('0'); if IsNeg then Temp := -Temp; + {$IFNDEF LFONLY} Inc(PCur); + {$ENDIF} DoTemp := False; end; if ABytes[PCur] = 59 then @@ -552,8 +556,13 @@ procedure TWSThreadsWatcher.Execute; if Size > High(LongInt) then Size := High(LongInt) - 100; StartP := FS.Position; - FS.Position :=FS.Position + Size; + FS.Position := FS.Position + Size; + {$IFNDEF LFONLY} GetNextLineBreak(FS); + {$ELSE} + while (FS.Position < FS.Size) and (FS.ReadByte <> 10) do + FS.Seek(1, soCurrent); + {$ENDIF} EndP := FS.Position; WSThread := TWSThread.Create(StartP, EndP, FWSManager); WSThread.Start;