Before this commit, when GNAT needed to emit lines longer than
the buffer, it accidentally inserted a newline in its output when
attempting to flush its buffer.
We fix this by using Flush_Buffer instead of Write_Eol in Write_Char.
gcc/ada/
* output.adb (Write_Buffer): Use Flush_Buffer instead of Write_Eol.
procedure Write_Char (C : Character) is
begin
- pragma Assert (Next_Col in Buffer'Range);
- if Next_Col = Buffer'Length then
- Write_Eol;
+ if Next_Col > Buffer'Length then
+ Flush_Buffer;
end if;
+ pragma Assert (Next_Col in Buffer'Range);
if C = ASCII.LF then
Write_Eol;