public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Marc Poulhi?s <dkm@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-4972] ada: output.adb: fix newline being inserted when buffer is full Date: Tue, 3 Jan 2023 09:34:45 +0000 (GMT) [thread overview] Message-ID: <20230103093445.151233858C2D@sourceware.org> (raw) https://gcc.gnu.org/g:238ff612f2fd88372c585753dd2faa73cb94cbb5 commit r13-4972-g238ff612f2fd88372c585753dd2faa73cb94cbb5 Author: Ghjuvan Lacambre <lacambre@adacore.com> Date: Thu Dec 8 09:58:28 2022 +0100 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. Diff: --- gcc/ada/output.adb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/ada/output.adb b/gcc/ada/output.adb index 33d027ded8e..497643d17ec 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;
reply other threads:[~2023-01-03 9:34 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230103093445.151233858C2D@sourceware.org \ --to=dkm@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).