aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/output.adb
diff options
context:
space:
mode:
authorGhjuvan Lacambre <lacambre@adacore.com>2022-12-08 09:58:28 +0100
committerMarc Poulhiès <poulhies@adacore.com>2023-01-03 10:29:54 +0100
commit238ff612f2fd88372c585753dd2faa73cb94cbb5 (patch)
tree6b75e6a23f45427c2db1565569e7f830cc3b8a69 /gcc/ada/output.adb
parent54d7221aca4b4aa2e20534924215cc39ebe2cd73 (diff)
downloadgcc-238ff612f2fd88372c585753dd2faa73cb94cbb5.zip
gcc-238ff612f2fd88372c585753dd2faa73cb94cbb5.tar.gz
gcc-238ff612f2fd88372c585753dd2faa73cb94cbb5.tar.bz2
ada: output.adb: fix newline being inserted when buffer is full
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.
Diffstat (limited to 'gcc/ada/output.adb')
-rw-r--r--gcc/ada/output.adb6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/ada/output.adb b/gcc/ada/output.adb
index 33d027d..497643d 100644
--- a/gcc/ada/output.adb
+++ b/gcc/ada/output.adb
@@ -422,10 +422,10 @@ package body Output is
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;