public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Binutils <binutils@sourceware.org>
Subject: Re: [PATCH] gas: improve interaction between read_a_source_file() and s_linefile()
Date: Mon, 13 Feb 2023 21:01:59 +1030	[thread overview]
Message-ID: <Y+oRn68c7GcfCwSe@squeak.grove.modra.org> (raw)
In-Reply-To: <08d262e3-c736-85ff-c45e-db96e55cff4c@suse.com>

On Mon, Feb 13, 2023 at 09:15:36AM +0100, Jan Beulich wrote:
> read_a_source_file() would bump line numbers only when seeing a newline,
> whereas is_end_of_line[] indicates further end-of-line characters, in
> particular the nul character. s_linefile() attempts to compensate for
> the bump, but was too aggressive with this so far: It should only adjust
> when a newline ends the line. To facilitate such a check, the check for
> nothing else on the line needs to move ahead, which luckily is easily
> possible: The relevant two conditions match, and the function can
> simply return from the body of that earlier instance of the conditional.
> 
> The more strict treatment in s_linefile() then requires an adjustment
> to buffer_and_nest()'s invocation of the function: The line terminator
> now needs to be a newline, not nul.

Looks good to me, thanks for sorting this out.

-- 
Alan Modra
Australia Development Lab, IBM

      reply	other threads:[~2023-02-13 10:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-13  8:15 Jan Beulich
2023-02-13 10:31 ` Alan Modra [this message]

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=Y+oRn68c7GcfCwSe@squeak.grove.modra.org \
    --to=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=jbeulich@suse.com \
    /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: link
Be 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).