public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Clément Chigot" <chigot@adacore.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: binutils@sourceware.org
Subject: Re: [PATCH] windres: add quotes around preprocessor cmd if needed
Date: Tue, 28 Jun 2022 16:18:53 +0200	[thread overview]
Message-ID: <CAJ307EjJCrmJzQjCdL4ObLHgkkwi3A1QFnUwd7BpEgSf=h3XQw@mail.gmail.com> (raw)
In-Reply-To: <8f8b421d-7cc5-1b4f-7e55-5f4b41716b4c@suse.com>

On Tue, Jun 28, 2022 at 3:52 PM Jan Beulich <jbeulich@suse.com> wrote:
>
> On 28.06.2022 14:26, Clément Chigot wrote:
> > On Tue, Jun 28, 2022 at 11:37 AM Clément Chigot <chigot@adacore.com> wrote:
> >>
> >> On Tue, Jun 28, 2022 at 11:00 AM Jan Beulich <jbeulich@suse.com> wrote:
> >>>
> >>> On 28.06.2022 09:35, Clément Chigot via Binutils wrote:
> >>> Shouldn't you also (optionally) quote the pre-processor string
> >>> if that came into read_rc_file() as non-NULL? Everything else looks
> >>> okay to me.
> >>
> >> Yeah. I didn't run into this issue but looking at the code it should happen
> >> too. Thanks for pointing it out !
> >
> > Actually the space issue is already handled by windres.c:
> > https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=binutils/windres.c;h=4df821ee8451bda70490d6626707c2bdd66eeb5f;hb=HEAD#l887
> > It's not as complete as it should be. But apart of "%" I'm not sure
> > any other characters caught by "filename_need_quotes" can happen
> > in a folder name under Windows.
>
> Oh, I see. I'm not sure I see a strong need for dealing with %, so
> I'm wondering: Are you intending to make an updated patch, or do
> you want to commit the one you've got (which I'm okay with given
> your observation)?

Honestly, if this patch fits you, I would merge it as is. This issue is already
a corner case, but as it's hidden inside windres code and because of
the existence of the "Program Files" folder can be problematic.
The other has to be triggered by someone explicitly passing "--preprocessor"
with an unusual path. So honestly I don't think it would ever happen.

> > Making "filename_need_quotes" more global might be a good idea
> > anyway.
>
> Right, but that could be a separate change then.

Agreed.

  reply	other threads:[~2022-06-28 14:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28  7:35 Clément Chigot
2022-06-28  9:00 ` Jan Beulich
2022-06-28  9:37   ` Clément Chigot
2022-06-28 10:16     ` Jan Beulich
2022-06-28 11:57       ` Clément Chigot
2022-06-28 12:26     ` Clément Chigot
2022-06-28 13:51       ` Jan Beulich
2022-06-28 14:18         ` Clément Chigot [this message]
2022-06-28 14:40           ` Jan Beulich
2022-06-28 14:55             ` Clément Chigot

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='CAJ307EjJCrmJzQjCdL4ObLHgkkwi3A1QFnUwd7BpEgSf=h3XQw@mail.gmail.com' \
    --to=chigot@adacore.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).