This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [Patch][windres] Handle embedded spaces in input filenames
- From: Ian Lance Taylor <iant at google dot com>
- To: Danny Smith <dannysmith at clear dot net dot nz>
- Cc: "'Binutils'" <binutils at sourceware dot org>
- Date: 05 Feb 2007 12:15:42 -0800
- Subject: Re: [Patch][windres] Handle embedded spaces in input filenames
- References: <000001c748f1$74c25700$b44861cb@anykey>
Danny Smith <dannysmith@clear.net.nz> writes:
> > -----Original Message-----
> > From: Christopher Faylor
> >
> >>The problem is that these option args are passed to prepocessor
> without
> >>the enclosing quotes. Fixed like so:
>
> > I can't check right now but is this because windres is using system to
> > call the preprocessor rather than calling fork/exec? If so, wouldn't
> it
> > be better to just use execvp?
>
> The preprocessor cmd string -- which is built by concat of the various
> windres args -- is run using pexecute. This, in turn, uses
> CreateProcess.
pexecute is supposed to handle all required quoting. If your example
is indeed using pexecute, then the place to fix is
libiberty/pex-win32.c.
I see that there is a code path in resrc.c which does not use
pexecute. In some cases open_input_stream will call popen. That code
path should be changed to use pex_run and pex_read_output (which did
not exist when I wrote resrc.c). Then the code should work without
requiring quoting in windres.c.
Ian