[Patch][windres] Handle embedded spaces in input filenames
Ian Lance Taylor
iant@google.com
Mon Feb 5 20:51:00 GMT 2007
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
More information about the Binutils
mailing list