Skip to content

Commit 4b7a84b

Browse files
authored
Merge pull request #144 from paweld/gus
`LF` support in the `Székely Balázs` version
2 parents 276e35d + aaf4d2f commit 4b7a84b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

entries/sbalazs/src/uweatherstations.pas

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
{$R-} {$Q-}
55
{$INLINE ON}
66

7+
{$define LFONLY}
8+
79
interface
810

911
uses
@@ -314,7 +316,9 @@ procedure TWSThread.ProcessBytes(ABytes: TBytes);
314316
Temp := Temp*10 + Ord(ABytes[PCur]) - Ord('0');
315317
if IsNeg then
316318
Temp := -Temp;
319+
{$IFNDEF LFONLY}
317320
Inc(PCur);
321+
{$ENDIF}
318322
DoTemp := False;
319323
end;
320324
if ABytes[PCur] = 59 then
@@ -552,8 +556,13 @@ procedure TWSThreadsWatcher.Execute;
552556
if Size > High(LongInt) then
553557
Size := High(LongInt) - 100;
554558
StartP := FS.Position;
555-
FS.Position :=FS.Position + Size;
559+
FS.Position := FS.Position + Size;
560+
{$IFNDEF LFONLY}
556561
GetNextLineBreak(FS);
562+
{$ELSE}
563+
while (FS.Position < FS.Size) and (FS.ReadByte <> 10) do
564+
FS.Seek(1, soCurrent);
565+
{$ENDIF}
557566
EndP := FS.Position;
558567
WSThread := TWSThread.Create(StartP, EndP, FWSManager);
559568
WSThread.Start;

0 commit comments

Comments
 (0)