From: Gaius Mulley Date: Sun, 1 Jun 2025 10:25:25 +0000 (+0100) Subject: PR modula2/120474: InOut buffering should flush the WriteLn before the Read X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13498bf4fcff4c0633678c53a46b6be425d2904c;p=thirdparty%2Fgcc.git PR modula2/120474: InOut buffering should flush the WriteLn before the Read This patch adds a BufferFlush to InOut.mod:LocalWrite. gcc/m2/ChangeLog: PR modula2/120474 * gm2-libs-log/InOut.mod (LocalWrite): Call FIO.FlushBuffer. Signed-off-by: Gaius Mulley --- diff --git a/gcc/m2/gm2-libs-log/InOut.mod b/gcc/m2/gm2-libs-log/InOut.mod index 79c706aa8d8..6b03034cde4 100644 --- a/gcc/m2/gm2-libs-log/InOut.mod +++ b/gcc/m2/gm2-libs-log/InOut.mod @@ -257,16 +257,8 @@ END WriteString ; PROCEDURE LocalWrite (ch: CHAR) ; BEGIN FIO.WriteChar(outFile, ch) ; - Done := FIO.IsNoError(outFile) -(* - IF outUsed - THEN - FIO.WriteChar(outFile, ch) ; - Done := FIO.IsNoError(outFile) - ELSE - Done := (write(stdout, ADR(ch), 1) = 1) - END -*) + Done := FIO.IsNoError(outFile) ; + FIO.FlushBuffer (outFile) END LocalWrite ;